1
I’m trying to implement the SUM
within those lines of code to sum the two columns Litro
and TotalGasto
Code:
var teste = consulta.Where(i => i.DtAbastecido >= dataInicio &&
i.DtAbastecido <= dataFinal)
.Sum(x =>x.Litro)
.GroupBy(x => new { x.NumCarro.NCarro })
.Select(x => x.First())
.OrderBy(x => x.NumCarro.NCarro);
But I’m getting the following error:
'int' does not contain a Definition for 'Groupby' and no Extension method 'Groupby' Accepting a first argument of type 'int' could be found (are you Missing a using Reference or an Assembly Reference?)