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); }
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); }