Group By Multiple Columns - LINQ
- by Nev_Rahd
How can I do GroupBy Multiple Columns in LINQ
Something as in SQL :
SELECT * FROM <TableName> GROUP BY <Column1>,<Column2>
How Can i convert below to LINQ
QuantityBreakdown
(
MaterialID int,
ProductID int,
Quantity float
)
INSERT INTO @QuantityBreakdown (MaterialID, ProductID, Quantity)
SELECT MaterialID, ProductID, SUM(Quantity)
FROM @Transactions
GROUP BY MaterialID, ProductID
Thanks