public InvestecOpenApiService(IMemoryCache cache, InvestecOpenApiHttpClient httpClient, InvestecOpenApiConfiguration openApiConfiguration, ILogger <InvestecOpenApiService> logger) { this._httpClient = httpClient; this._openApiConfiguration = openApiConfiguration; this._logger = logger; this._cache = cache; }
public static IServiceCollection AddInvestecOpenApi(this IServiceCollection services, InvestecOpenApiConfiguration investecOpenApiConfiguration) { services.AddSingleton(investecOpenApiConfiguration); services.AddScoped <IInvestecOpenApiService, InvestecOpenApiService>(); services.AddLogging(); services.AddScoped <InvestecOpenApiHttpClient>(client => new InvestecOpenApiHttpClient { BaseAddress = new Uri(investecOpenApiConfiguration.Url) }); return(services); }