score:3
Accepted answer
.select(grouping => new
{
tag = grouping.key,
amount = grouping.count(),
items = grouping.select(item => item.item)
})
Source: stackoverflow.com
Related Query
- Operating on lists by grouped property values
- C# LINQ : Dynamically create property and values that includes sum of a value from a grouped query
- LINQ compare lists and update property with values from found object
- Use Linq to create sub lists grouped by a property
- Compare two lists via two property in addition to having list of unique values from third property creating new lists
- In LINQ, select all values of property X where X != null
- Compare Two Lists Via One Property Using LINQ
- How to join two Lists based on common property
- How to get a list of the grouped values in linq groupby?
- Comparing two Lists and returning the distinct values and the differences
- Left join on two Lists and maintain one property from the right with Linq
- Check if a list contains all of another lists items when comparing on one property
- Getting unique values from a list of objects with a List<string> as a property
- Get grouped comma separated values with linq
- Linq get values not shared across multiple lists
- Get the number of distinct property values in List<T> using LINQ in C#
- Filter two lists on one property c# using linq
- Linq - operating on lists of lists
- Summing values across nested lists at each index
- C# LINQ Select objects with the same value of one property join values of other
- Use Linq to filter Hashtable based on a property of Values custom object
- Get values by property name from an object at different levels
- Using Linq and C#, trying to get two lists from a list of master items grouped by two inner lists
- C# Create object with dynamic properties : LINQ select List<object> values by property names array
- Merge 2 lists based on one property and concatenate other properties
- HashSet or Distinct to read distinct values of property in List<> of objects
- Entity Framework / Linq - Get distinct values of dynamically specified property
- Combine two lists into one based on property
- How to merge two lists on a given property
- How to compare values in 2 lists
More Query from same tag
- Use delegate for Projection in Linq to SQL
- How do I get property names of a type using a lambda expression and anonymous type?
- Efficiently retrieving and filtering files
- Find closest value in a list in C# with linq?
- Get element or default value?
- Sql ExecuteSqlCommand to LINQ
- How to use count in linq
- LINQ - convert group to array
- Matching XElements in an XDocument against a list of names
- Can this Aggregate Lambda expression be converted to a LINQ query?
- Linq to entities navigation properties
- using LINQ to get the top N percent of a list
- Why, the first query.ToList() work, but the second not work?
- Calculation int to decimal fails
- Not properly Grouping items in a collection with LINQ
- Handling null results with the LINQ Average() method
- Group by entities using LINQ
- c# Linq select distinct date time days
- C# Group by one property select the newest one from the group
- Why decrementing one variable modifies incrementing of another one in C# Parallel.ForEach loop?
- IQueryable<T>.Include() gets ignored
- Nested ASP.NET Datalist with Entity framework?
- How can I convert this SQL to VB.NET LINQ
- How can I get the average of two different columns in linq?
- Select the first records for a property with linq
- How can I generate this property implementation using Expressions instead of emitting IL?
- Select specific element by using Linq
- Performance of Linq query by type
- Group by List in LINQ
- Unable to cast object of type grouping to datarow after i grouped datatable with linq