public IActionResult Delete(int id) { _itemService.Delete(id); var items = _itemService.GetAll(); var itemDtos = _mapper.Map <IList <ItemDto> >(items); return(Ok(itemDtos)); }
public IActionResult Delete(int id) { var success = _itemsService.Delete(id); if (success) { return(Redirect("/Items/DeleteSuccess")); } return(Redirect(Items_Root_Path)); }
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); }
public IActionResult Delete([FromForm] int itemid) { itemsService.Delete(itemid); return(RedirectToAction("Delete")); }
public IEnumerable <ToDoItem> Delete(int id) { itemsService.Delete(id); return(itemsService.GetAll()); }