IEnumerable<Customer> filteredList = originalList
.GroupBy(customer => customer.CustomerId)
.Select(group => group.First());
More Related Contents:
- Getting all types that implement an interface
- C# Lambda expressions: Why should I use them?
- Why must a lambda expression be cast when supplied as a plain Delegate parameter
- AddRange to a Collection
- FindAll vs Where extension-method
- How to unsubscribe from an event which uses a lambda expression?
- Get All instead of FirstOrDefault
- Why is there no ForEach extension method on IEnumerable?
- Difference between Property and Field in C# 3.0+
- Does C# have extension properties?
- Mutating the expression tree of a predicate to target another type
- Timeout Pattern – How bad is Thread.Abort really?
- What’s the hardest or most misunderstood aspect of LINQ? [closed]
- What Advantages of Extension Methods have you found? [closed]
- Replace parameter in lambda expression
- Weak event handler model for use with lambdas
- Entity Framework Filter “Expression”
- The ‘await’ operator can only be used within an async lambda expression
- Why can I not edit a method that contains an anonymous method in the debugger?
- What’s the point of a lambda expression?
- Proper Currying in C#
- How to merge a list of lists with same type of items to a single list of items?
- Func delegate with ref variable
- Ambiguous call between two C# extension generic methods one where T:class and other where T:struct
- Can I use extension methods and LINQ in .NET 2.0 or 3.0?
- Why doesn’t VS 2008 display extension methods in Intellisense for String class
- Is there a way to specify an “empty” C# lambda expression?
- F# extension methods in C#
- Lambda Expression for join
- Why is it impossible to declare extension methods in a generic static class?