Bug #71138 use Any mehod in linq, system throw Not ImplementedException
Submitted: 13 Dec 2013 2:55 Modified: 25 Oct 2014 22:18
Reporter: Henry Lu Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connector / NET Severity:S1 (Critical)
Version:6.8.1 OS:Windows
Assigned to: Assigned Account CPU Architecture:Any

[13 Dec 2013 2:55] Henry Lu
Description:
When we use Any mehod in linq, system throw Not ImplementedException

How to repeat:
Model:
public class SalesOrder {
        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        public int OrderId { get; set; }

        public virtual IList<SalesOrderLine> Lines { get; set; }
}

    public class SalesOrderLine
    {
        [Key]
        [System.ComponentModel.DataAnnotations.Schema.Column(Order = 1)]
        public int OrderId { get; set; }

        [Key]
        [System.ComponentModel.DataAnnotations.Schema.Column(Order = 2)]
        public int LineNum { get; set; }

        [ForeignKey("OrderId")]
        public SalesOrder SalesOrder { get; set; }

        public string ItemCode{ get; set; }

}

Controller:
string itemcode = "test";
var orderList = dbContext.SalesOrder.Where(m=>m.Lines.Any(l=>l.ItemCode == itemcode));

Suggested fix:
When I use this linq, it's ok:
const string itemcode = "test";
var orderList = dbContext.SalesOrder.Where(m=>m.Lines.Any(l=>l.ItemCode == itemcode);
[16 Dec 2013 23:17] Fernando Gonzalez.Sanchez
Hi,

cannot repro this, can you provide more details?
Which OS? Visual Studio version? Entity Framework Version? .NET version?

Thanks.
[27 Dec 2013 5:49] Henry Lu
WIN7, VS2010. EF4.4, .NET Framework4
[27 Dec 2013 5:50] Henry Lu
when i use 6.8.3, the issue still not fixed.
thanks
[25 Sep 2014 22:18] Fernando Gonzalez.Sanchez
Thanks for the report but,

Still cannot reproduce this with either EF5 for VS2010 (EF 4.4) or VS2013 nor EF6 with VS2013, with Connector/NET 6.9.3.

If you can provide way to repro, please upload a sample project.
otherwise will have to close it as non reproducible.
[26 Oct 2014 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".