Filtering lists using LINQ
Have a look at the Except method, which you use like this: var resultingList = listOfOriginalItems.Except(listOfItemsToLeaveOut, equalityComparer) You’ll want to use the overload I’ve linked to, which lets you specify a custom IEqualityComparer. That way you can specify how items match based on your composite key. (If you’ve already overridden Equals, though, you shouldn’t need … Read more