If the complex object is your own creation, just implement IEquatable
Once you've implemented IEquatable
Here are the results of the IEquatable
If you find yourself in a situation where the complex object can't be extended to implement IEquatable, there's a solution for that, too. You'll create an additional class that implements IEqualityComparer and then specify that when you invoke the .Distinct() call on your list.
Here are the results of using the IEqualityComparer approach:
No comments:
Post a Comment