Revision: 63125
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at April 10, 2013 07:32 by kwhite1975
Initial Code
myObject.GroupBy(c => c.Id).Select(grp => grp.First());
Initial URL
http://stackoverflow.com/questions/1300088/distinct-with-lambda
Initial Description
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.
Initial Title
Lambda Expression To Select a distinct set of objects
Initial Tags
Initial Language
C#