Suppose this is my member class
class Member
{
public string CategoryId { get; set; }
public string MemberName { get; set; }
public int Distance { g
This is similar to those above, however it is technically a one liner for those interested....
var queryResult= (from l in list
select new Member()
{
CategoryId = l.CategoryId ,
MemberName = l.MemberName
Distance = l.Distance
}).GroupBy(x=>x.CatagoryId).Select(z=>z.OrderBy(i=>i.Distance).First()).ToList();