public IActionResult DeletedPizzaFromList(int id) { var pizzaVM = _pizzaService.GetPizzaById(id); _pizzaService.DeletePizza(pizzaVM); return(RedirectToAction("Index")); }
public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var pizza = _service.GetPizza(id); if (pizza == null) { return(HttpNotFound()); } if (!Request.IsAjaxRequest()) { return(RedirectToAction("Index")); } _service.DeletePizza(pizza); _service.SavePizza(); return(Json("", JsonRequestBehavior.AllowGet)); }
public void DeletePizza(PizzaVM pizza) { var pizzaDto = _pizzaService.GetPizzaById(pizza.Id); _pizzaService.DeletePizza(pizzaDto.Id); }
//[SwaggerResponse(System.Net.HttpStatusCode.OK, Type = typeof(DeleteUserResponse))] public IActionResult Delete(Guid id) { DeletePizzaResponse deletePizzaResponse = _pizzaService.DeletePizza(new DeletePizzaRequest(id)); return(Ok(deletePizzaResponse)); }
public void Delete(int id) { _pizzaService.DeletePizza(id); }