1) Note that Person is likely not a value type, but a reference type. Therefore, Except will not compare values, but rather references. If you want to apply the "Except" logic by a property of the instances (let's say "Name"), then use something like this:
string[] valuesToExclude = list1.Select(person => person.Name).ToArray();
var newList = list2.Where(person => !valuesToExclude.Contains(person.Name)).ToList();
2) You could alternatively pass an IEqualityComparer<Person> to Except:
public class PersonComparer : IEqualityComparer<Person>
{
public bool Equals(Person x, Person y)
{
return Equals(x.Name, y.Name);
}
public int GetHashCode(Person obj)
{
return obj.Name.GetHashCode();
}
}
It's the second parameter, as in:
var newList = list2.Except(list1, new PersonComparer()).ToList();
3) Lastly, it's worth noting that if Person were a struct (value type), then your code would work as-is, assuming that all the properties matched for the instances you are excepting. For example:
public struct Person
{
public string Name { get; set; }
}
List<Person> list1 = new List<Person>
{
new Person { Name = "A" },
new Person { Name = "B" },
};
List<Person> list2 = new List<Person>
{
new Person { Name = "A" },
};
var newList = list1.Except(list2).ToList();
// "B" only