I have a query that returns me a list of Categories grouped by Univers and ordered by Univers name. I would like the list of results also being ordered by category name (C.Name), here is my Linq query:
public static IEnumerable<IGrouping<String, String>> GetCatalogUnivCateg(){
var contexte = new AV2_Entities();
var query = from C in contexte.Category
group C.Name by C.Univers.Name into g
orderby g.Key
select g;
return query.ToList();
}
I would like to understand how is applied the group by, when the results has an orderby.