コード例 #1
0
        public CategoryProductsDTO GetCategoryProducts(string CategoryName)
        {
            bool exists = productDatabaseContext.CategoryExists(CategoryName);

            if (!exists)
            {
                throw new CategoryDoesNotExistsException();
            }
            CategoryProductsDTO newCategoryProductsDTO = productDatabaseContext.GetCategoryProducts(CategoryName);

            return(newCategoryProductsDTO);
        }
コード例 #2
0
        public CategoryProductDTO GetCategoryProducts(string CategoryName)
        {
            try
            {
                bool CategoryExist = productDatabaseContext.CategoryExists(CategoryName);
            }
            catch (NotFoundException ex)
            {
                throw new CatgoryDoesNotExistsException();
            }
            CategoryProductDTO categoryProductDTO = productDatabaseContext.GetCategoryProducts(CategoryName);

            return(categoryProductDTO);
        }