Short question:
Is there a simple way in LINQ to objects to get a distinct list of objects from a list based on a key property on the objects.
This is the best i can come up with for the problem in hand.
Still curious whether theres a nice way to create a EqualityComparer
on the fly though.
Galleries.SelectMany(x => x.Images).ToLookup(x => x.id).Select(x => x.First());
Create lookup table and take 'top' from each one
Note: this is the same as @charlie suggested but using ILookup - which i think is what a group must be anyway.