This is my table:
How is this SQL statement done with Entity Framework:
I appreciate any help
CodePudding user response:
Method Syntax:
var result = yourTable.GroupBy(i => i.ProductoId)
.Select(g => (g.Key,g.Sum(ing => ing.SumaUnidadesIngresados))
Query syntax:
var result = from i in ingresosStock
group i by i.ProductoId into gr
select (gr.Key, gr.Sum(s => s.SumaUnidadesIngresados))