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); }
public async Task <RedirectToActionResult> Delete(int id) { await _productCatalogService.DeleteProduct(id); return(RedirectToAction("Index")); }