Exemplo n.º 1
0
        public ICommandResult CreateServidor(CreateBeneficioServidorCommand command)
        {
            command.Validate();

            if (!command.Valid)
            {
                return(new CommandResult(success: false, message: "Erro ao criar servidor", data: command.Notifications));
            }

            return(_handler.Handle(command));
        }
Exemplo n.º 2
0
 public IActionResult Create([FromBody] CreateBeneficioServidorCommand command)
 {
     try
     {
         var result = _servidorService.CreateServidor(command);
         return(Ok(result));
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }