如何将以下查询转换为字典Dictionary<key, List<StudentSummary>
以用于以下LINQ查询:
在字典中,Key
将被视为first group by Key
,即x.test.a
和List<StudentSummary>
将在linq查询中进行全部第二次选择。
private void get(baseQuery) {
List<StudentSummary> summary = baseQuery
.GroupBy(x =>x.test.a)
.Select(x=>new StudentSummary {
Name = x.key.
StudentDetails = baseQuery
.GroupBy(y=>y.test1.b)
.OrderBy(y => y.key)
.Select(y => new StudentDetails {
studentDetailsProp1 = 10;
studentDetailsProp2 = 10;
}).ToList(),
TotalMarks =100;
}).ToList();
}