I have a strongly typed list of custom objects, MyObject, which has a property Id, along with some other properties.
MyObject
Id
Let\'s say that the
You can override Equals and GetHashCode, implement an IEqualityComparer and use that in the Contains call, or use an extension method like Any
IEqualityComparer
Contains
Any
if (!myList.Any(obj => obj.Property == obj2.Property && obj.Property2 == obj2.Property2)) myList.Add(obj2);