tags:

views:

69

answers:

1

query = query.Where(m => m.People.Contains(s)).Select(m => m).ToList();

In the above, "People" is an IList of strings. IF I replace People with a list of objects with string as a field of that object, how do I get the same results.

+5  A: 

How about:

query = query.Where(m => m.People.Any(p => p.SomeProp == s)).ToList();
Marc Gravell
+1 You beat me to it
Mehrdad Afshari