/// <summary> /// Returns the focus categories 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 focus categories.</returns> public PagedQueryResults <FocusCategoryDTO> GetFocusCategoriesByOfficeId(int officeId, QueryableOperator <FocusCategoryDTO> queryOperator) { var results = FocusCategoryQueries.CreateGetFocusCategoryDTOByOfficeIdQuery(this.Context, officeId, queryOperator).ToPagedQueryResults(queryOperator.Start, queryOperator.Limit); logger.Trace("Retrieved focus categories for office with id [{0}].", officeId); return(results); }
/// <summary> /// Returns the focus categories for the program with the given id. /// </summary> /// <param name="officeId">The program by id.</param> /// <param name="queryOperator">The query operator.</param> /// <returns>The focus categories.</returns> public async Task <PagedQueryResults <FocusCategoryDTO> > GetFocusCategoriesByProgramIdAsync(int programId, QueryableOperator <FocusCategoryDTO> queryOperator) { var results = await FocusCategoryQueries.CreateGetFocusCategoryDTOByProgramIdQuery(this.Context, programId, queryOperator).ToPagedQueryResultsAsync(queryOperator.Start, queryOperator.Limit); logger.Trace("Retrieved focus categories for program with id [{0}].", programId); return(results); }
private IQueryable <int> CreateGetAllowedCategoryIdsQuery(int officeId) { return(FocusCategoryQueries.CreateGetFocusCategoryDTOByOfficeIdQuery(this.Context, officeId).Select(x => x.Id)); }