Exemplo n.º 1
0
 public IActionResult AddTodo(AddTodoPostModel addTodoPostModel)
 {
     if (ModelState.IsValid)
     {
         _cmdHandler.Handle(new AddTodo(Guid.NewGuid(), addTodoPostModel.Description));
     }
     return(PartialView("_TodoListPartial", todoListPartialViewModel()));
 }
 public IActionResult AddTodo(AddTodoPostModel postModel)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest());
     }
     _cmdHandler.Handle(new AddTodo(Guid.NewGuid(), postModel.Description));
     return(Ok());
 }