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)); }
public IActionResult Create([FromBody] CreateBeneficioServidorCommand command) { try { var result = _servidorService.CreateServidor(command); return(Ok(result)); } catch (Exception ex) { return(BadRequest(ex.Message)); } }