【发布时间】:2013-08-27 10:24:22
【问题描述】:
我有学生表和科目表,我需要按科目对学生进行分组。我尝试了以下不显示 s.StudentSubjects.SubjectName 。如何使用子表编写分组。
学生 -> 学生 ID |名称
StudentSubjects -> SubjectID |学生证 |主题名称
var list = from s in students
group s by s.StudentSubjects.? into g
select new StudentSubjectsCounts
{
Name = g.Key,
Count = g.Count(),
};
【问题讨论】:
标签: c# .net linq entity-framework