<dl><dt/><dd>Generic type parameter of the parent object.</dd><dt/><dd>Generic type parameter of the property value.</dd></dl>
## Example
using System; using System.Collections.Generic; using System.Linq; class Program { static void Main(string[] args) { var people = new List<Person> { new Person { Name = "Alice", Age = 30 }, new Person { Name = "Bob", Age = 30 }, new Person { Name = "Charlie", Age = 35 } }; var comparer = new PropertyComparer<Person, int>(p => p.Age); var distinctPeople = people.Distinct(comparer).ToList(); foreach (var person in distinctPeople) { Console.WriteLine($"{person.Name} - {person.Age}"); } } } class Person { public string Name { get; set; } public int Age { get; set; } }
<td>Determines whether the specified object is equal to the current object.<br/>(Inherited from <ahref="https://learn.microsoft.com/dotnet/api/system.object"target="_blank"rel="noopener noreferrer">Object</a>)</td></tr>
<td>Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.<br/>(Inherited from <ahref="https://learn.microsoft.com/dotnet/api/system.object"target="_blank"rel="noopener noreferrer">Object</a>)</td></tr>
<td>Serves as the default hash function.<br/>(Inherited from <ahref="https://learn.microsoft.com/dotnet/api/system.object"target="_blank"rel="noopener noreferrer">Object</a>)</td></tr>
<td>Gets the <ahref="https://learn.microsoft.com/dotnet/api/system.type"target="_blank"rel="noopener noreferrer">Type</a> of the current instance.<br/>(Inherited from <ahref="https://learn.microsoft.com/dotnet/api/system.object"target="_blank"rel="noopener noreferrer">Object</a>)</td></tr>
<td>Creates a shallow copy of the current <ahref="https://learn.microsoft.com/dotnet/api/system.object"target="_blank"rel="noopener noreferrer">Object</a>.<br/>(Inherited from <ahref="https://learn.microsoft.com/dotnet/api/system.object"target="_blank"rel="noopener noreferrer">Object</a>)</td></tr>
<td>Returns a string that represents the current object.<br/>(Inherited from <ahref="https://learn.microsoft.com/dotnet/api/system.object"target="_blank"rel="noopener noreferrer">Object</a>)</td></tr>