public async Task <ActionResult> Delete(Guid id, Product product)
        {
            try
            {
                await _service.DeleteProduct(id);

                return(RedirectToAction(nameof(Index)));
            }
            catch (Exception exc)
            {
                return(View("Error", new ErrorViewModel {
                    RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier, Description = exc?.Message
                }));
            }
        }
 public async Task Delete(Guid id)
 {
     await _catalogService.DeleteProduct(id);
 }
Beispiel #3
0
        public async Task <RedirectToActionResult> Delete(int id)
        {
            await _productCatalogService.DeleteProduct(id);

            return(RedirectToAction("Index"));
        }