无法识别的表达式节点: ArrayIndex
--------------------编程问答--------------------
你确定c.ID对应的Key在socre内就一定能找得到?
--------------------编程问答--------------------
Dictionary<int, int> score = new Dictionary<int,int>();
var sq = from s in udc.Tbscore
join c in udc.Tbcourse on s.CourseID equals c.ID
let temp=score.Select(s=>s.Key)
where s.ClassID == cid && s.TestID == tid
&& s.GradeID == gid
&&temp.Contains(c.ID) && s.Score >= score[c.ID]
group c by c.ID into g
let nu = g.First()
orderby nu.ID
select new {
NumOK = (from n in nu.Tbscore
where n.ClassID == cid
group n by n.StuID).Count(),
NumSum = Convert.ToDecimal((from n in nu.Tbscore where n.ClassID == cid && n.Score >= score[g.Key] group n by n.StuID).Count()) / Convert.ToDecimal((from n in nu.Tbscore where n.ClassID == cid group n by n.StuID).Count())
};
补充:.NET技术 , LINQ