Пример #1
0
 public IQueryable <PersonWithStaff> GetStaffNotifyHr()
 {
     return(from person in PeopleWithStaff.Where(staff => staff.StaffId != null)
            from user in _dbConnection.Users.InnerJoin(u => person.Id == u.PersonId)
            where user.SendHrLeaveEmails
            select person);
 }
Пример #2
0
 private IQueryable <PersonWithStaff> GetStaffWithUserRole(string roleName)
 {
     return(from person in PeopleWithStaff.Where(staff => staff.StaffId != null)
            from user in _dbConnection.Users.InnerJoin(u => person.Id == u.PersonId)
            from userRole in _dbConnection.UserRoles.InnerJoin(u => u.UserId == user.Id)
            from role in _dbConnection.Roles.InnerJoin(role => role.Id == userRole.RoleId)
            where role.NormalizedName == roleName.ToUpper()
            select person);
 }