日期:2014-05-20  浏览次数:20984 次

linq源码改错!!!
这个对应我的另一个帖子中提到的较复杂的功能的代码;用的自己的思路写的,第一次碰C#,劳烦各位版主原谅我的各种低级错误阿

var reportQuery = from a in examReportTable.AsEnumerable()
                  join b in rvuTable.AsEnumerable()
                  on new{exam=a.Field<string>("exam"), examtype=a.Field<string>("examtype")} equals new{rvuName=b.Field<string>("rvuName"), rvuType=b.Field<string>("rvuType")}
                  group b by new{ reportDoc=a.Field<string>("reportDoc"),examtype=a.Field<string>("examtype") } into c                      
                  select new
                  {                        
                            DocName = c.Field<string>("reportDoc"),
                            examType = c.Field<string>("type"),
                            reportDocRvu = c.Field<double>.Sum(o=>o.reportRvu),
                            reportDocNum = c.Field<double>.count(o=>o.reportRvu)
                   };


var auditQuery = from aa in examAuditTable.AsEnumerable()
                 join bb in rvuTable.AsEnumerable()
                 on new{exam=aa.Field<string>("exam"),examtype=aa.Field<string>("examtype")} equals new{rvuName=bb.Field<string>("rvuName"),rvuType=bb.Field<string>("rvuType")}