Example #1
0
        public IActionResult Delete(int id)
        {
            _itemService.Delete(id);
            var items    = _itemService.GetAll();
            var itemDtos = _mapper.Map <IList <ItemDto> >(items);

            return(Ok(itemDtos));
        }
Example #2
0
        public IActionResult Delete(int id)
        {
            var success = _itemsService.Delete(id);

            if (success)
            {
                return(Redirect("/Items/DeleteSuccess"));
            }

            return(Redirect(Items_Root_Path));
        }
Example #3
0
        public JsonResult Delete(int id)
        {
            if (id < 1)
            {
                return(Json(new { message = "Не cохранено" }));
            }

            bool isDeleted = itemsService.Delete(id);

            return(Json(new { message = isDeleted ? "Удалено" : "Не удалено" }));
        }
        public ActionResult <bool> DeleteItem(Guid id)
        {
            var item = _itemsService.Exists(id);

            if (item == null)
            {
                return(NotFound());
            }

            var result = _itemsService.Delete(id);

            return(result);
        }
Example #5
0
 public IActionResult Delete([FromForm] int itemid)
 {
     itemsService.Delete(itemid);
     return(RedirectToAction("Delete"));
 }
Example #6
0
 public IEnumerable <ToDoItem> Delete(int id)
 {
     itemsService.Delete(id);
     return(itemsService.GetAll());
 }