Hello,
I am playing with Linq to learn about it but I can't figure out how to Distinct when I do not have a simple list (a simple list of integer is pretty easy to do, this is not the question). What if want to distinct a list of Object on ONE or MORE Properties of the object?
Example: If an object is "Person", with Property "Id". How can I get all Person and distinct them by the property Id of the object?
Person1: Id=1, Name="Test1"
Person2: Id=1, Name="Test1"
Person3: Id=2, Name="Test2"
How can I get just Person1 and Person3? Is that possible?
If it's not possible with Linq, what would be the best way to have a list of "Person" depending of some of its Properties in .Net 3.5?