コード例 #1
0
        public IActionResult DeletedPizzaFromList(int id)
        {
            var pizzaVM = _pizzaService.GetPizzaById(id);

            _pizzaService.DeletePizza(pizzaVM);
            return(RedirectToAction("Index"));
        }
コード例 #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));
        }
コード例 #3
0
        public void DeletePizza(PizzaVM pizza)
        {
            var pizzaDto = _pizzaService.GetPizzaById(pizza.Id);

            _pizzaService.DeletePizza(pizzaDto.Id);
        }
コード例 #4
0
        //[SwaggerResponse(System.Net.HttpStatusCode.OK, Type = typeof(DeleteUserResponse))]
        public IActionResult Delete(Guid id)
        {
            DeletePizzaResponse deletePizzaResponse = _pizzaService.DeletePizza(new DeletePizzaRequest(id));

            return(Ok(deletePizzaResponse));
        }
コード例 #5
0
 public void Delete(int id)
 {
     _pizzaService.DeletePizza(id);
 }