Linq SUM query not calculating sum of values in a column
I have a IQueryable collection with a column called Amount and I want to
get the sum of values for Amount column for all the rows.
collection.Select(x => x.Amount).Sum();
collection.Sum(a => a.Amount);
Unfortunately, both the above queries are not working.
No comments:
Post a Comment