var sessions from mark in marksList join student in studentsList on ma

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
var sessions =
from mark in marksList
join student in studentsList
on mark.StudentID equals student.ID
where (student.LastName == lastName) && (student.FirstName == firstName) && (student.SecondName == secondName)
orderby mark.SessionNumber ascending,
mark.Subject ascending,
mark.Status ascending
group mark by mark.SessionNumber
into session
select session;
foreach (var session in sessions) {
Console.WriteLine ("Оценки студента {1} {2} {3} за сессию {0}: ", session.Key, lastName, firstName, secondName);
foreach (var mark in session) {
Console.WriteLine ("{0}: {1} (status == {2})", mark.Subject, mark.MarkType, mark.Status);
}
Console.WriteLine ();
}