using Microsoft.Extensions.Logging; using DD.Persistence.Client.Clients.Base; using DD.Persistence.Client.Clients.Interfaces; using DD.Persistence.Client.Clients.Interfaces.Refit; using DD.Persistence.Models; namespace DD.Persistence.Client.Clients; public class DataSourceSystemClient : BaseClient, IDataSourceSystemClient { private readonly IRefitDataSourceSystemClient dataSourceSystemClient; public DataSourceSystemClient(IRefitClientFactory dataSourceSystemClientFactory, ILogger logger) : base(logger) { this.dataSourceSystemClient = dataSourceSystemClientFactory.Create(); } public async Task Add(DataSourceSystemDto dataSourceSystemDto, CancellationToken token) { await ExecutePostResponse( async () => await dataSourceSystemClient.Add(dataSourceSystemDto, token), token); } public async Task> Get(CancellationToken token) { var result = await ExecuteGetResponse( async () => await dataSourceSystemClient.Get(token), token); return result!; } public void Dispose() { dataSourceSystemClient.Dispose(); GC.SuppressFinalize(this); } }