Accepted answer

Grouping by each property individually will result in the same as a concatenated grouping

SomeList.GroupBy(x => new {x.Code, x.Location});


To answer your specific question

Is there a way to temporarily concatenate variables in a GroupBy...

someList.GroupBy(x => new { TempConcat = x.Code + x.Location })

However I believe the answer by NinjaNye is better for what you want, rather than what you asked for :).

Related Articles