Sunday, May 1, 2011

How to select items that do not show up in a second list with Linq

I have two lists and I want to select items that are not in the second list from the first list. I have no Linq experience to I think this should be a good way to start learning.

From stackoverflow
  • You can use Except for this:

    var query = list1.Except(list2);
    
    Erich Mirabal : +1 Exceptional answer. Succinct.

0 comments:

Post a Comment