public async Task <Category> GetCategoryTrAsync(int id, bool showProducts) { var CategoryEntity = await CategoriesTrRepository.GetCategoryTrAsync(id, showProducts); if (CategoryEntity == null) { throw new NotFoundItemException("Category not found"); } return(mapper.Map <Category>(CategoryEntity)); }
private async Task ValidateCategory(int id) { var Category = await EcomakRepository.GetCategoryTrAsync(id); if (Category == null) { throw new NotFoundItemException($"cannot found Category with id:{id}"); } }