I have two lists of object.
List obj1 = new List();
List obj2 = new List();
I
The Except
method requires that the two collection types involved have the same element type. In this case the element types are different (object1
and object2
) hence Except
isn't really an option. A better method to use here is Where
obj2 = obj2
.Where(x => !obj1.Any(y => y.StringProperty == x.StringProperty))
.ToList();