Exemplo n.º 1
0
        public async Task <IActionResult> Create(CreateAgentCommand command)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var result = await _agentService.CreateAsync(command);

            return(Created($"/agent/{result.Id}", result));
        }
Exemplo n.º 2
0
        public async Task <Result <AgentDto> > Create([FromBody] AgentDto dto)
        {
            var agent = await _agentService.CreateAsync(dto);

            return(Result <AgentDto> .Success(data : agent));
        }