score:2
Accepted answer
Grouping by each property individually will result in the same as a concatenated grouping
SomeList.GroupBy(x => new {x.Code, x.Location});
score:0
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 :)
.
Source: stackoverflow.com
Related Articles
- Concatenate string in GroupBy
- List or Array of String Contain specific word in Html Source Code
- C# - code to order by a property using the property name as a string
- Concatenate string properties of an object with lambda
- Concatenate int and string in LINQ to Entities
- Concatenate a constant string to each item in a List<string> using LINQ
- using LINQ how can i concatenate string properties from itesm in a collection
- .NET String parsing performance improvement - Possible Code Smell
- Using GroupBy in linq to group the letters of a string
- LINQ Source Code Available
- GroupBy String and Count in LINQ
- Efficient way to unindent lines of code stored in a string
- Concatenate All Properties to a String with LINQ
- .NET 4 Code Contracts: "requires unproven: source != null"
- The given value of type String from the data source cannot be converted to type int of the specified target column
- LINQ Lambda efficiency of code groupby orderby
- How to concatenate result of GroupBy using Linq
- creating Linq to sqlite dbml from DbLinq source code
- Concatenate string from array and include it's index C#
- LINQ: concatenate multiple int properties into a string
- Entity Framework Code First String Comparison with Oracle Db
- Simle/Nested foreach to linq( Concatenate string and Datatable rows and columns)
- linq to entities changing database connection string in code
- Getting all elements concatenate in a string with LINQ
- LINQ GroupBy string PagePath
- How to group in linq list and concatenate some string in c# linq
- How to concatenate string with decimal?
- Dealing with a null column in LINQ while concatenate to a string
- Concatenate Datetime and string and bind result to dropdownlist using Json method
- Concatenate collection of XML tags to string with LINQ
- Comparing two datatables through Linq
- LINQ and .COUNT timing out
- How to do a specific order by in Entity Framework with a mixture of values and nulls
- Sort by any of 3 time fields
- Distinct Count x and Grouping by Date y
- Loop through list and compare previous line to current line. I have a list of account numbers mostly duplicates
- Applying expression tree for List through LINQ
- Left outer join and group by
- What do i use instead of e.Values.add(... for the ListViewEditEventArgs to upload an Image
- Persisting Lazy Loaded Properties
- Linq divided by zero error?
- Selecting records with max version
- Update a property in a sub list which contains in a list
- Using a Singleton pattern to Linq to Sql Data Context
- Empty string array to Union
- Linq Distinct not being very Distinct
- Multiple where conditions in EF using Lambda expressions
- "Selecting" or "Wrapping" an IQueryable so that it is still queryable
- Join Two Different Object DataType using Linq in C#
- The nested query is not supported