Ejemplo n.º 1
0
        public async Task <IActionResult> DeleteCategory(int id)
        {
            var categories = await _productsService.GetCategoriesAsync();

            if (!categories.Any(category => category.Id == id))
            {
                return(BadRequest("Category id not found"));
            }
            await _productsService.DeleteCategoryAsync(id);

            return(Ok(id));
        }