c# - Summation of data, linq -
i want summarize "count" field "room" , "object code" equal.
any ideas?
i have no idea how context set, table name , dozen other things necessary answer question, use groupby
linq method, like:
var results = db.tablename.groupby(x => new { x.room, x.objectcode }) .select(g => new { g.key.room, g.key.objectcode, count = g.sum(x => x.code) }) .tolist();
Comments
Post a Comment