LINQ to Entities does not recognize method

LINQ to Entities does not recognize the Boolean Contains (Int32) method, and this method cannot be translated into a repository expression.

var warranty_yes = from i in devicesEntities.device where i.WarrantyDate >= DateTime.Now select i.Id; var warranty_yes_list = warranty_yes.ToList(); var view_query = from i in devprim_by_status where warranty_yes_list.Contains(i.Id) select i; 

What is the solution to this problem?

0
source share
1 answer

You can do this in one request:

 var view_query = from i in devprim_by_status join d in deviceEntities.device on i.Id equals d.Id where d.WarrantyDate >= DateTime.Now select i; 
+3
source

All Articles