Parameterizing the list of range ceilings…
var ceilings = new[] { 10, 100, 500 };
var groupings = items.GroupBy(item => ceilings.First(ceiling => ceiling >= item));
More Related Contents:
- Group by in LINQ
- Group By Multiple Columns
- LINQ with groupby and count
- C# Linq Group By on multiple columns [duplicate]
- LINQ Grouping dynamically
- Client side GroupBy is not supported
- LINQ: combining join and group by
- Linq order by, group by and order by each group?
- LINQ Group By Multiple fields -Syntax help
- ILookup vs. IGrouping
- linq distinct or group by multiple properties
- LINQ to Entities group-by failure using .date
- Get All instead of FirstOrDefault
- How to write this nested foreach loop query in LINQ?
- Linq: GroupBy, Sum and Count
- LINQ to Entities does not recognize the method ‘System.String ToString()’ method, and this method cannot be translated into a store expression
- Find an item in a list by LINQ
- LINQ Select Distinct with Anonymous Types
- LINQ Orderby Descending Query
- How to get the closest number from a List with LINQ?
- Extension methods syntax vs query syntax
- Convert string to int array using LINQ [duplicate]
- How set value a property selector Expression
- How do I perform Date Comparison in EF query?
- Should I use two “where” clauses or “&&” in my LINQ query?
- Get a list of distinct values in List
- Performance of Find() vs. FirstOrDefault() [duplicate]
- Remove item from list based on condition
- LINQ Query to Convert string to datetime
- Convert DataTable to Generic List in C#