I just discovered that Except() will remove all elements in the second list from the first, but it also has the effect that it makes all elements in the returned result distinct.
Simple way around I am using is Where(v => !secondList.Contains(v))
Can anyone explain to me why this is the behavior, and if possible point me to the documentation that explains this?
The documentation for the
Exceptfunction states:The important word here is set, which is defined as:
Because
Exceptis documented as a set-based operation, it also has the effect of making the resulting values distinct.