コード例 #1
0
        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
                }));
            }
        }
コード例 #2
0
 public async Task Delete(Guid id)
 {
     await _catalogService.DeleteProduct(id);
 }
コード例 #3
0
        public async Task <RedirectToActionResult> Delete(int id)
        {
            await _productCatalogService.DeleteProduct(id);

            return(RedirectToAction("Index"));
        }