예제 #1
0
        public async Task <IActionResult> DeleteProduct([FromQuery] Guid id)
        {
            _logger.LogThisMethod();
            var productDeleted = await _catalogService.DeleteProductAsync(id);

            if (productDeleted.IsNull())
            {
                return(BadRequest());
            }
            return(Ok(productDeleted));
        }
        public async Task <IActionResult> Delete(Guid id)
        {
            await _catalogService.DeleteProductAsync(id);

            return(RedirectToAction(nameof(ProductsController.Products)));
        }