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)); }
public async Task <Result <AgentDto> > Create([FromBody] AgentDto dto) { var agent = await _agentService.CreateAsync(dto); return(Result <AgentDto> .Success(data : agent)); }