LINQ to Objects - NOT IN query
I have two string arrays (let call them “AllEmployees”, and “ActiveEmployees”) that I’d like to compare with LINQ to find all inactive employees (b开发者_StackOverflowasically all those in AllEmployees that aren’t in ActiveEmployees.
How can I do that using LinQ?
Thanks!
How about?:
var inactiveEmployees = AllEmployees.Except(ActiveEmployees);
System.Linq.Enumerable.Except
精彩评论