public RequestService(IHttpService httpService, IDBService dbService, IRequestDBService requestDBService, IOptions <ServicesOptions> options) { _httpService = httpService; _dbService = dbService; _requestDBService = requestDBService; _config = options.Value; }
private async void CheckServices(object state) { using (var scope = _serviceScopeFactory.CreateScope()) { IHttpService _httpService = scope.ServiceProvider.GetRequiredService <IHttpService>(); IDBService _dbService = scope.ServiceProvider.GetRequiredService <IDBService>(); IRequestDBService _requestDBService = scope.ServiceProvider.GetRequiredService <IRequestDBService>(); var services = _dbService.GetServices(); foreach (var service in services) { _requestDBService.SetData(await _httpService.CheckService(service)); } } }
public RequestController(IRequestDBService requestDBService) { _requestDBService = requestDBService; }