Beispiel #1
0
 public GenericCommandResult Update(
     [FromBody] UpdateLeilaoCommand command,
     [FromServices] LeilaoHandler handler
     )
 {
     command.User = User.Claims.FirstOrDefault(x => x.Type == "user_id")?.Value;
     return((GenericCommandResult)handler.Handle(command));
 }
Beispiel #2
0
        public GenericCommandResult Delete(
            long id,
            [FromServices] LeilaoHandler handler
            )
        {
            var command = new DeleteLeilaoCommand();

            command.User = User.Claims.FirstOrDefault(x => x.Type == "user_id")?.Value;
            command.Id   = id;
            return((GenericCommandResult)handler.Handle(command));
        }
 public void Dado_um_comando_invalido_deve_interromper_a_execucao()
 {
     _result = (GenericCommandResult)_handler.Handle(_invalidCommand);
     Assert.AreEqual(_result.Success, false);
 }