public EndpointSwitchingMiddleware( RequestDelegate next, IProxyDynamicRoutesConfigurationService proxyDynamicRoutesConfigurationService, IEnumerable <EndpointDataSource> endpointSources, ILogger <EndpointSwitchingMiddleware> logger, IConfiguration configuration) { this.next = next; this.apiEndpointConfigurationService = proxyDynamicRoutesConfigurationService; this.logger = logger; this.configuration = configuration; endpoints = endpointSources .SelectMany(e => e.Endpoints) .OfType <RouteEndpoint>(); }
public ProxyController(IProxyDynamicRoutesConfigurationService proxyConfigurationService, IProxyConfigProvider proxyConfigProvider, IConfiguration configuration) { this.proxyConfigurationService = proxyConfigurationService ?? throw new ArgumentNullException(nameof(proxyConfigurationService)); this.proxyConfigProvider = proxyConfigProvider ?? throw new ArgumentNullException(nameof(proxyConfigProvider)); this.configuration = (IConfigurationRoot)configuration ?? throw new ArgumentNullException(nameof(configuration)); }