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

Popular posts from this blog

c++ - protocol buffers - generate NON-inline accessors -

c# - issue attaching/adding an entity object which is detached from the DB Context? -