public ICommandResult Handle(CreateToDoCommand command) { //fast fail validation command.Validate(); if (command.Invalid) { return(new CommandResult(false, "Requisição falhou", command.Notifications)); } //gerar o todo var todo = new TodoItem(command.Title, command.Date, command.User); //persiste no banco _todoRepository.CreateItem(todo); return(new CommandResult(true, "Tarefa criada com sucesso", todo)); }