score:5

Accepted answer

you could remove the middle select and just order the groups by the sums and then select the product.

var list = list.groupby(t => t.parentproduct)
               .orderby(group => group.sum(t => t.numberoforders))
               .select(group => group.key);

Related Query

More Query from same tag