public async Task <List <CustomSelectListItem> > GetMaterialTypesAsSelectListItem(int?categoryId) { var materialTypes = await materialTypeReadRepository.GetMaterialTypesAsSelectListItem(categoryId); if (materialTypes == null || !materialTypes.Any()) { logger.Error(NoRecordsExists); throw new ResourceNotFoundException(NoRecordsExists); } if (!materialTypes.Any(x => x.Selected)) { logger.Error(SelectedSubCategoriesDoesNotExistErrorMessage); throw new Exception(SelectedSubCategoriesDoesNotExistErrorMessage); } return(materialTypes); }
protected virtual async Task <List <CustomSelectListItem> > GetMaterialTypeAsSelectListItem(int?categoryId) { return(await materialTypeReadRepository.GetMaterialTypesAsSelectListItem(categoryId)); }