Reputation: 1046
I have a linq query, that gets data from a table in a DataContext object. One of the columns in this table has a Datatype of float. I would like to get the total of that specific column. How could I go about doing this?
Upvotes: 0
Views: 1341
Reputation: 59685
var sum = context.Foos.Sum(foo => foo.Bar);
... assuming an entity type named Foo
with a numerical column named Bar
.
Upvotes: 3