-2

My object is like

class MyObject
{
string FirstName, string LastName, string Phone
}

and I have two list of this object:

incomingList<MyObject>
fullList<MyObject>

How can I have a list of the things that are in the incomingList but are not in the fullList

2 Answers2

4

Use Enumerable.Except:

IEnumerable<MyObject> diffs = incomingList.Except(fullList);
demoncodemonkey
  • 11,730
  • 10
  • 61
  • 103
3

Enumerable.Except is what you after

var result = incomingList.Except(fullList);
huMpty duMpty
  • 14,346
  • 14
  • 60
  • 99