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)
                        });

Related Articles