public static void AddPersonalDataExchange(this IServiceCollection services, IConfiguration configuration) { services.TryAddScoped <IZeiterfassungsService, ZeiterfassungsService>(); var pdeConfig = new PersonalDataExchangeConfig(); configuration.GetSection("EdiConfig").Bind(pdeConfig); services.TryAddSingleton(pdeConfig); services.AddHttpClient("edi", c => { c.BaseAddress = new Uri(pdeConfig.Endpoint); }); services.TryAddScoped <IIBMiSQLApi, IBMiSQLApi>(); var epConf = new EndpointConfiguration(); configuration.GetSection("SqlEndpoint").Bind(epConf); services.TryAddSingleton(epConf); services.AddHttpClient("sqlapi", c => { c.BaseAddress = new Uri(epConf.Api); }); services.AddStartupTask <ZeiterfassungsCustomizingCacheStartupTask>(); }
public ZeiterfassungsService(ILogger <ZeiterfassungsService> logger, IHttpClientFactory httpClientFactory, PersonalDataExchangeConfig config, IIBMiSQLApi sqlApi, IMemoryCache memoryCache) { _logger = logger; _httpClientFactory = httpClientFactory; _config = config; _sqlApi = sqlApi; _memoryCache = memoryCache; }