Entity "IN" statement
Posted: Fri 09 Jan 2009 09:11
Hi guys,
I like to use the SQL "IN" statement equivalent in LINQ to Entity syntax. I understand the .Contains extension method is not supported by Microsoft. Can anyone provide me with an alternative ?
This does not work, using dotConnect for Oracle.
List myList = new List(){122334455,155664455,9437646};
var result = from product in Context.Products.Include("Details")
where myList.Contains(product.Id)
select product;
I like to use the SQL "IN" statement equivalent in LINQ to Entity syntax. I understand the .Contains extension method is not supported by Microsoft. Can anyone provide me with an alternative ?
This does not work, using dotConnect for Oracle.
List myList = new List(){122334455,155664455,9437646};
var result = from product in Context.Products.Include("Details")
where myList.Contains(product.Id)
select product;