public ActionResult DeleteProductPost(int id) { try { bool result = productHandler.Delete(id); if (result) { return(RedirectToAction("GetProductList")); } else { this.ModelState.AddModelError("", "Something got wrong when delete product. Product not deleted!"); return(GetProductList()); } } catch (Exception ex) { this.ModelState.AddModelError("", ex.Message); if (ex.InnerException != null) { this.ModelState.AddModelError("", ex.InnerException.Message); } return(GetProductList()); } }
public async Task Delete(Guid productId) { await Task.Run(() => { _productHandler.Delete(productId); }); }
public void Delete(Guid id) { _prodHandler.Delete(id); }
// [Authorize(Roles="Admin")] public CommandResult Delete(string id) { var result = _handler.Delete(id); return(result); }
public async Task <ActionResult <MovieDto> > DeleteMovie(int id) { var movie = await handler.Delete(id); return(Ok(movie)); }