I am trying to figure out the correct syntax to make it work. Here is an example. Could you fix or translate it to linq syntax?
From p In products()
group p by p.Category into g
select new { Category = g.Key,
TotalUnitsInStock = if(g.key="b", g.Avg(p => p.UnitsInStock),
g.Sum(p => p.UnitsInStock))
In this example, the products will be data. Thank you
source
share