public IActionResult EditClient([FromBody] EditClientCommand editClientCommand) { try { var client = _clientAggregateFactory.Create(editClientCommand.Id); client.Edit(editClientCommand); _clientsWriteRepository.Save(client); return(Ok()); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public async Task <BaseResponse> Edit(EditClientCommand command, int clientId) { command.Id = clientId; return(await _clienteHandler.Handle(command)); }