public GenericCommandResult UpdateAccount( [FromBody] AlterarUsuarioCommand command, [FromServices] AlterarUsuarioCommandHandler handler ) { var idUsuario = HttpContext.User.Claims.FirstOrDefault(c => c.Type == JwtRegisteredClaimNames.Jti); command.IdUsuario = new Guid(idUsuario.Value); return((GenericCommandResult)handler.Handle(command)); }
public ICommandResult AlterarUsuario(AlterarUsuarioCommand command, [FromServices] AlterarUsuarioCommandHandler handler) { command.IdUsuario = Guid.Parse(HttpContext.User.Claims.FirstOrDefault(c => c.Type == JwtRegisteredClaimNames.Jti).Value); return((GenericCommandResult)handler.Handle(command)); }