public async Task <MaturityLevel> ExecuteAsync(GetMaturityLevelQueryRequestModel queryRequest) { var maturityLevel = await this.maturityLevelsRepository.GetAsync(queryRequest.Id); if (maturityLevel == null) { throw new HttpException(HttpStatusCode.NotFound, $"MaturityLevel (ID: {queryRequest.Id}) cannot be found."); } return(MaturityLevel.FromTableRecord(maturityLevel)); }
public async Task <ActionResult <GetMaturityLevelResponseModel> > Get( [FromRoute] Guid id ) { var queryRequest = new GetMaturityLevelQueryRequestModel { Id = id }; var queryResponse = await this.getMaturityLevelQuery.ExecuteAsync(queryRequest); return(GetMaturityLevelResponseModel.FromBusinessModel(queryResponse)); }