Ejemplo n.º 1
0
        public IActionResult DeletedPizzaFromList(int id)
        {
            var pizzaVM = _pizzaService.GetPizzaById(id);

            _pizzaService.DeletePizza(pizzaVM);
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
        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));
        }
Ejemplo n.º 5
0
 public void Delete(int id)
 {
     _pizzaService.DeletePizza(id);
 }