var result = list.GroupBy(x => x.Category).Select(x => x.First())
More Related Contents:
- How to write this nested foreach loop query in LINQ?
- How to use LINQ to select object with minimum or maximum property value
- Linq: GroupBy, Sum and Count
- Update all objects in a collection using LINQ
- LINQ Aggregate algorithm explained
- LINQ Grouping dynamically
- Why does Enumerable.All return true for an empty sequence? [duplicate]
- C# – code to order by a property using the property name as a string [duplicate]
- Can I specify my explicit type comparator inline?
- Am I misunderstanding LINQ to SQL .AsEnumerable()?
- Extension methods syntax vs query syntax
- Conversion from List to array T[]
- LINQ Where Ignore Accentuation and Case
- How do I create an expression tree calling IEnumerable.Any(…)?
- Find all child controls of specific type using Enumerable.OfType() or LINQ
- Join and Include in Entity Framework
- What is the performance of the Last() extension method for List?
- Should I use two “where” clauses or “&&” in my LINQ query?
- Max or Default?
- Performance of Find() vs. FirstOrDefault() [duplicate]
- Remove Item in Dictionary based on Value
- Remove item from list based on condition
- How to sort a dictionary by key
- Last and LastOrDefault not supported
- How does PredicateBuilder work
- Issues Doing a String Comparison in LINQ
- LINQ Using Max() to select a single row
- Should the order of LINQ query clauses affect Entity Framework performance?
- Map two lists into a dictionary in C#
- Can I use Linq’s Except() with a lambda expression comparer?