score:2
Accepted answer
you can return distinct values of the platform
collection by using enumerable.distinct()
.
the platforms
value in the result selector in your .groupby()
operation should be computed as follows:
platforms = g.select(p => p.platform).distinct().tolist()
score:0
maybe you could try something like this:
var group = recordlist.groupby(r => r.article)
.select(a =>
new
{
article = a.key,
platforms = a.groupby(g => g.platform)
});
Source: stackoverflow.com
Related Query
- How to use LINQ Group Records and use Distinct
- how to use group by in linq C# and fetch the list of records
- How to use Linq Group By and Distinct for Treeview
- How to use distinct with group by in Linq to SQL
- How to use group by and having count in Linq
- How to use Linq to select and group complex child object from a parents list
- How should i use group by and sum on different values of list of models using linq
- How to use Group By, Sum, and Contains in a single LINQ query?
- How can I use order by and group by in Linq Extraction Method?
- How to use having ,group by and distinct in linq or lambda expression
- How to use group by and min statment of linq for one array?
- How do you use linq to group records based on an accumulator?
- How do I use LINQ with GROUP BY and multiple MAX(...) to select multiple fields?
- How do I use the having clause on an aggregate in a complex group by and join query in LINQ
- How can I use order by and group by in Linq Extraction Method and With multiple data?
- How to use LINQ to group by and order by certain column
- How to use LINQ to group by one field, sort within that grouping, and sum values for that combination?
- How to use Linq instead of foreach to Group and Count
- How to use Group By with Join and Min in Linq
- LINQ - How to group and count distinct values?
- How to use SUM and GROUP BY function in LINQ
- How to use group by and also sum on a database record using linq
- How to use linq with an aggregate , join and Group by
- How to assign LINQ Query to a variable and then use it later in the code
- How to use Max and Group By in LINQ
- Linq using how to use order by and group by with left join?
- How to select Distinct / Group By child property in both LINQ method and syntax?
- How to write SQL translateable linq code that groups by one property and returns distinct list
- How to use linq to split a list of objects by half and then group them
- How do I use Group By and MAX in Linq to return multiple rows?
More Query from same tag
- can not addRange of items to var using linq and c#
- The result type of the query is neither an EntityType nor a CollectionType with an entity element type
- Return LINQ query to DataTable .NET 3.5?
- Retrieve values from List<T> property and cast to Dictionary<string,string> C#
- LINQ group items into lists in anonymous type, with duplicates
- Sorting an array of List<string> using linq
- Combining two LINQ queries that only their return result is different
- LINQ Set Operations not working (Intersect, Except)
- linq join and count
- Convert ToDecimal from Decimal? returns sometimes returns null instead of 0
- how to find date range between two dates in days format using linq c#
- Check if any XML nodes exists with Specific Attribute using LINQ C#
- Scala Linq alternative
- Update IEnumerable<XElement> and save changes in XML document C#
- Is it possible to return the object with the minimal property in a list?
- How can I get back from an un-typed Expression to a typed one?
- Fetch data by upcoming birthdays in linq to sql
- Compare two lists, item by item, using linq
- How to retrieve multiple column values with same foreign key id using Linq method Syntax in C#?
- Concat First and Last Name MVC5
- Create inversed datatable from object list
- XML elements to array of bool
- Cannot implicitly convert type 'System.Linq.IQueryable<AnonymousType#6>' to 'decimal'
- What is wrong with Zip Method in Linq using C#?
- Query list for items based on function result
- LINQ GroupBy return dictionary with given objects as value
- How to filter records from a db using linq expressions?
- how to make Value cannot be null, null
- Asp.net Core 5.0 Linq Take(1).ElementAt(index)
- Creating a Linq group by query