LINQ query NOT IN
I have this simple SQL query using NOT IN
operator:
SELECT * FROM List l WHERE L.ListName NOT IN ('POType','MailClass')
How can I write this using LINQ query syntax?
Solution 1:
string[] listNames = {"POType", "MailClass"};
var query = from l in List
where ! listNames.Contains(l.ListName)
select l;