示例#1
0
 public InvestecOpenApiService(IMemoryCache cache, InvestecOpenApiHttpClient httpClient, InvestecOpenApiConfiguration openApiConfiguration, ILogger <InvestecOpenApiService> logger)
 {
     this._httpClient           = httpClient;
     this._openApiConfiguration = openApiConfiguration;
     this._logger = logger;
     this._cache  = cache;
 }
示例#2
0
        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);
        }