Exemple #1
0
        public GenericCommandResult MarkAsDone(
            [FromBody] MarkTodoAsDoneCommand command,
            [FromServices] MarkTodoAsDoneHandler handler,
            Guid id
            )
        {
            if (id != command.Id)
            {
                return(new GenericCommandResult(false, "Id não encontrado", false));
            }

            var user = User.Claims.FirstOrDefault(x => x.Type == "user_id")?.Value;

            command.User = user;
            return((GenericCommandResult)handler.Handle(command));
        }