Exemplo n.º 1
0
 public IActionResult Edit(Task task)
 {
     if (ModelState.IsValid)
     {
         Task updatedTask = taskRepository.UpdateTask(task);
         return(RedirectToAction("details", new { id = updatedTask.Id }));
     }
     return(View());
 }
Exemplo n.º 2
0
 public IActionResult Create(Task task)
 {
     if (ModelState.IsValid)
     {
         Task newTask = taskRepository.AddTask(task);
         return(RedirectToAction("details", new { id = newTask.Id }));
     }
     return(View());
 }