<t>EDIT: This is now part of MoreLINQ.<br/>
<br/>
What you need is a "distinct-by" effectively. I don't believe it's part of LINQ as it stands, although it's fairly easy to write:<br/>
<br/>
public static IEnumerable DistinctBy<br/>
(this IEnumerable source, Func keySelector)<br/>
{<br/>
HashSet seenKeys = new HashSet();<br/>
foreach (TSource element in source)<br/>
{<br/>
if (seenKeys.Add(keySelector(element)))<br/>
{<br/>
yield return element;<br/>
}<br/>
}<br/>
}<br/>
<br/>
```<br/>
<br/>
So to find the distinct values using just the `Id` property, you could use:<br/>
<br/>
```<br/>
var query = people.DistinctBy(p => p.Id);<br/>
<br/>
```<br/>
<br/>
And to use multiple properties, you can use anonymous types, which implement equality appropriately:<br/>
<br/>
```<br/>
var query = people.DistinctBy(p => new { p.Id, p.Name });<br/>
<br/>
```<br/>
<br/>
Untested, but it should work (and it now at least compiles).<br/>
<br/>
It assumes the default comparer for the keys though - if you want to pass in an equality comparer, just pass it on to the `HashSet` constructor.</t>