Answers for "group by multiple fields linq"

C#
2

Group by linq multiple columns C#

var query = (from t in Transactions
             group t by new {t.MaterialID, t.ProductID}
             into grp
                    select new
                    {
                        grp.Key.MaterialID,
                        grp.Key.ProductID,
                        Quantity = grp.Sum(t => t.Quantity)
                    }).ToList();
Posted by: Guest on May-19-2021

Code answers related to "group by multiple fields linq"

C# Answers by Framework

Browse Popular Code Answers by Language