public IActionResult Delete(int id) { var delete = _todolistService.Delete(id); if (delete > 0) { return(Ok(delete)); } return(BadRequest("Delete Failed!")); }
public IActionResult Delete(int id) { var data = _toDoListService.Delete(id); if (data > 0) { return(Ok(data)); } return(BadRequest("Failed")); }
public async Task <ToDo> Delete(int id) { //var task = await _toDoListService.GetById(id); //if (task == null) //{ // return null; //} return(await _toDoListService.Delete(id)); }
public ActionResult Delete(int id) { var result = _toDoListService.Delete(id); if (result.HasError) { SetErrorMessage(result.Message); } ClearCache(id); return(RedirectToAction("List")); }
protected void rptToDoList_ItemCommand(object source, RepeaterCommandEventArgs e) { int id = Convert.ToInt32(e.CommandArgument); if (e.CommandName == "Delete") { var toDoList = _toDoListService.Get(id); _toDoListService.Delete(toDoList); } LoadToDoList(); }
public IActionResult DeleteList(int?id) { if (id == null) { return(RedirectToAction("Index")); } var entity = _toDoListService.GetById((int)id); if (entity != null) { _toDoListService.Delete(entity); } return(RedirectToAction("Index")); }