code_junkie

How can I use a List<> as the condition for my where clause with Linq?

Nov 13th, 2011
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. var results = from x in x.table
  2. where x.Equals(List<string>)
  3. select x;
  4.  
  5. List<string> yourList = new List<string> { "A", "B", "C" };
  6.  
  7. var results = from x in x.table
  8. where yourList.Contains(x)
  9. select x;
Add Comment
Please, Sign In to add comment