c# - Sum using from clause (linq) -
i've got following command:
var sum = mylist.sum(p => p.field);
is possible write same command using clause? eg.
var sum = mylist ...
there no expression sum in notation. here close can get:
var sum = (from p in mylist select p.field).sum();
Comments
Post a Comment