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; }
public static IQueryable<Student> GetStudentsByUser(this IQueryable<Student> students, User user) { return students.Where(s => s.AssociatedUsers.Select(u => u.Id).Contains(user.Id)); }