I have a list of objects that has some duplicates by a property. I would like to get all non-duplicate and also 1 of the duplicates based on a condition.
For eg.
Something like
list.GroupBy(item=>item.Code).Select(item=>new {code = item.Key, grade = item.Max(i=>i.Grade)}).ToList();