Page 1 of 1

Entity "IN" statement

Posted: Fri 09 Jan 2009 09:11
by BreakFire
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;

Posted: Fri 09 Jan 2009 14:00
by AndreyR