public async Task <CreateClientPayload> UpdateClientAsync([Service] IClientService service, ClientInput input, CancellationToken cancellationToken) { var client = input.Adapt <ApplicationClient>(); await service.UpdateAsync(client, cancellationToken); return(new CreateClientPayload { ApplicationClient = client.Adapt <ClientDto>() }); }
public async Task <CreateClientPayload> CreateClientAsync([Service] IClientService service, ClientInput input, CancellationToken cancellationToken) { var client = input.Adapt <ApplicationClient>(); client.Id = Guid.TryParse(input.ClientId, out var guid) ? guid : Guid.NewGuid(); await service.CreateAsync(client, cancellationToken); return(new CreateClientPayload { ApplicationClient = client.Adapt <ClientDto>() }); }