M
Michael C
Stefan Hoffmann said:Have you read Frans Bouma's post? The grouping on an anonymous type is a
very smart solution.
I like it:
.GroupBy(i => new { Tab = i.Tab, Value = i.Value })
It's not a bad solution but I would think it's the third solution I would
pick. It's not as efficient as the other methods as it creates a new
anonymous object for each row. The first method I suggested of overriding
GetHashCode is not always possible because you can only do this once and you
might want to group by different properties at different times and
gethashcode should only return the same values if the 2 objects and
considered equal. The custom comparer can be done in a few lines of code and
less if you use an existing class.
Michael