Tag: set intersection

自定义在lambda中相交

我想知道使用lambda表达式是否可以解决这个问题: List listOne = service.GetListOne(); List listTwo = service.GetListTwo(); List result = new List(); foreach(var one in listOne) { foreach(var two in listTwo) { if((one.Id == two.Id) && one.someKey != two.someKey) result.Add(one); } }