Linq qurery with multiple where's

Posted by Dan on Stack Overflow See other posts from Stack Overflow or by Dan
Published on 2010-03-31T17:49:18Z Indexed on 2010/03/31 17:53 UTC
Read the original article Hit count: 255

Filed under:
|
|

I am trying the to query my Status Update repository using the following

    var result = (from s in _dataContext.StatusUpdates
                  where s.Username == "friend1" && s.Username == "friend2" etc...
                  select s).ToList();

Insead of using s.Username == "friendN" continously is there anyway I can pass a list or array or something like that rather that specifying each one, or can i use a foreach loop in the middle of the query.

Thanks

© Stack Overflow or respective owner

Related posts about LINQ

Related posts about c#