public ActionResult DeleteTask(MyTasksIdEntryModel entryModel) { if (ModelState.IsValid) { var commands = ServiceFactory.GetCommands(); commands.DeleteTask(entryModel); } return Json("Task Deleted"); }
public void DeleteTask(MyTasksIdEntryModel entryModel) { var task = _dataContext.Tasks.FindSingle(TaskSpecs.GetTaskById(entryModel.Id)); _dataContext.Tasks.Delete(task); }