예제 #1
0
        public FilterActionFactory(IServiceProvider serviceProvider, IConfigurationContainer configurationContainer)
        {
            this.serviceProvider = serviceProvider;

            filtersDictionary = new ConcurrentDictionary <string, Tuple <IFilter, MappingFilterConfiguration> >(StringComparer.OrdinalIgnoreCase);
            configurationContainer.Configure <Dictionary <string, MappingFilterConfiguration> >("Filters", this.BindConfiguration);
        }
예제 #2
0
        public RouterFilter(
            IConfigurationContainer configurationContainer,
            IHttpClientFactory httpClientFactory,
            IFilterActionFactory filterActionFactory)
        {
            this.httpClientFactory   = httpClientFactory;
            this.filterActionFactory = filterActionFactory;
            configurationContainer.Configure <RoutingConfiguration>(string.Empty, cfg =>
            {
                cfg.Mappings = cfg.Mappings?.OrderByDescending(x => x.Value?.Path.Value.Length)
                               .ToDictionary(x => x.Key, x => x.Value);

                this.routingConfiguration = cfg;
            });
        }
예제 #3
0
 public CertificateProvider(IConfigurationContainer configurationContainer)
 {
     this.cacheDictionary = new ConcurrentDictionary <string, Tuple <X509Certificate2, CertificateConfiguration> >(StringComparer.OrdinalIgnoreCase);
     configurationContainer.Configure <Dictionary <string, CertificateConfiguration> >(Constants.RoutingCertificatesConfigurationSection, this.BindConfigure);
 }