/// <summary> /// Returns the justification objectives for the office with the given id. /// </summary> /// <param name="officeId">The office by id.</param> /// <param name="queryOperator">The query operator.</param> /// <returns>The justification objectives.</returns> public PagedQueryResults <JustificationObjectiveDTO> GetJustificationObjectivesByOfficeId(int officeId, QueryableOperator <JustificationObjectiveDTO> queryOperator) { var results = JustificationObjectiveQueries.CreateGetJustificationObjectiveDTByOfficeIdOQuery(this.Context, officeId, queryOperator).ToPagedQueryResults(queryOperator.Start, queryOperator.Limit); logger.Trace("Retrieved justification objectives for office with id [{0}].", officeId); return(results); }
/// <summary> /// Returns the justification objectives for the program with the given id. /// </summary> /// <param name="programId">The program by id.</param> /// <param name="queryOperator">The query operator.</param> /// <returns>The justification objectives.</returns> public async Task <PagedQueryResults <JustificationObjectiveDTO> > GetJustificationObjectivesByProgramIdAsync(int programId, QueryableOperator <JustificationObjectiveDTO> queryOperator) { var results = await JustificationObjectiveQueries.CreateGetJustificationObjectiveDTOByProgramIdQuery(this.Context, programId, queryOperator).ToPagedQueryResultsAsync(queryOperator.Start, queryOperator.Limit); logger.Trace("Retrieved justification objectives for program with id [{0}].", programId); return(results); }
private IQueryable <int> CreateGetAllowedObjectiveIdsQuery(int officeId) { return(JustificationObjectiveQueries.CreateGetJustificationObjectiveDTByOfficeIdOQuery(this.Context, officeId).Select(x => x.Id)); }