Пример #1
0
 public static string GetSchoolName(this IQueryable<School> schools, User user)
 {
     return schools.Where(s => s.Users.Select(u => u.Id).Contains(user.Id)).FirstOrDefault().SchoolName;
 }
Пример #2
0
 public static IQueryable<Student> GetStudentsByUser(this IQueryable<Student> students, User user)
 {
     return students.Where(s => s.AssociatedUsers.Select(u => u.Id).Contains(user.Id));
 }