public IActionResult Create(int userId) { Task t = new Task(userId); t.UserId = userId; return(View(t)); }
public IActionResult Edit([Bind("Id,Description, State, UserId")] Task task) { if (ModelState.IsValid) { _api.UpdateTask(task.UserId, task); return(RedirectToAction("Index", "Tasks", new { userId = task.UserId })); } return(View(task)); }
public IActionResult DeleteConfirmed(int userId, int id) { if (_api.DeleteTask(userId, id)) { return(RedirectToAction("Index", "Tasks", new { userId = userId })); } Task t = _api.GetTaskById(userId, id); ModelState.AddModelError(string.Empty, "Task couldn't be deleted"); return(View(t)); }
public IActionResult Edit(int userId, int id) { Task t = _api.GetTaskById(userId, id); return(View(t)); }