I have the following query that receives a list of ints as a parameter:
public int GetMostRecent(List<int> TheIDs)
{
...using MyDC...
var TheMostRecentID = (from d in MyDC.Data
where TheIDs.Contains(d.ID)
orderby d.DateTime
select d.ID).LastOrDefault();
}
Is this the best way to match a list within a parameter collection to data in the database or is there a better way than using the .Contains() method in linq-to-sql.
Thanks.