/ Published in: C#

This line of code allows you to group a set of objects by a field and then get the first item in that group. This allows you to do a distinct by a specific property.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
myObject.GroupBy(c => c.Id).Select(grp => grp.First());
URL: http://stackoverflow.com/questions/1300088/distinct-with-lambda
Comments
