[Solved] How do I group the data received from SQL server
[ad_1] If you want to retrieve only some of the columns then use the following overload: var result = data.GroupBy(key => key.Role, element => element.DocumentType); Otherwise you can also use this projection: var result = data.GroupBy(key => key.Role) .Select(g => new { Role = g.Key, Documents = g.Select(i => i.DocumentType) }); 3 [ad_2] solved How … Read more