linq distinct or group by multiple properties

It’s groups by needed properties and select:

List<Product> result = pr.GroupBy(g => new { g.Title, g.Price })
                         .Select(g => g.First())
                         .ToList();

Leave a Comment