I am doing GroupBy with Linq on IQueryable . But I would like to make GroupBy in a concatenated string. Now I have the following:
SomeList.GroupBy(x => x.Code + x.Location)
This works for me, however it also changed x.Code to a concatenated string x.Code + x.Location .
Is there a way to temporarily combine variables in GroupBy , something like:
SomeList.GroupBy(x => (x.Code + x.Location) as TempVar)
source share