Can LINQ to SQL query using NOT IN?
e.g., SELECT au_lname, state FROM authors WHERE state NOT IN ('CA', 'IN', 'MD')
List<string> states = new List<string> { "CA", "IN", "MD" }; var q = from a in authors where !states.Contains(a.state) select new { a.au_lname, a.state };
or
var q = authors.Where( a => !states.Contains( a.state ) ) .Select( a => new { a.au_lname, a.state } );
1.4m articles
1.4m replys
5 comments
57.0k users