开发者

LINQ to Objects - NOT IN query

开发者 https://www.devze.com 2023-03-10 13:01 出处:网络
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 AllEmp

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

0

精彩评论

暂无评论...
验证码 换一张
取 消