Nesting Linq-to-Objects query within Linq-to-Entities query –what is happening under the covers?
- by carewithl
var numbers = new int[] { 1, 2, 3, 4, 5 };
var contacts = from c in context.Contacts
where c.ContactID == numbers.Max() | c.ContactID == numbers.FirstOrDefault()
select c;
foreach (var item in contacts) Console.WriteLine(item.ContactID);
Linq-to-Entities query is first translated into Linq expression…