linq - Access any data that is not contained in grouped element -


from teambudget in teambudgets teambudget.teamid == 71002 join teambroker in teambrokers on 71002 equals teambroker.teamid join goal in goals on teambroker.globalbrokerid equals goal.globalbrokerid group goal goal.globalbrokerid g  select new  {     // teamid=teambroker.teamid,     // mtdgoal=teambudget.sum(t => t.budget),     revenuemtdcurrent = g.sum(x => x.revenuemtdcurrent) } 

commented part problem. how access data not contained in grouped element?

you need group multiple fields can access data.

like

var result = in                      (from uh in db.userhistories                       uh.user.userid == userid && uh.crmentityid == (int)entity                       select new { uh.actionid, uh.actiontype, uh.objectid })                  group new { i.actionid, i.actiontype, i.objectid } g                  select new { g.actionid, g.actiontype, g.objectid }; 

hope help


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -