Linq多字段分組

   var tj_query =
               from tv in
             (from sv in dbentities.Bus_StatisticalInfo.Where(x => x.departmentguid == find.departmentguid)
              where sv.createtime>= find.begintime  && sv.createtime<= find.endtime
              group sv by new {  sv.infoguid, sv.channelguid } into g1
              select new { g1.Key.infoguid, g1.Key.channelguid })

               group tv by tv.channelguid into g2
               select new Intranet() { Nature = (Guid)g2.Key, Done = g2.Count() };

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章