Exemplo n.º 1
0
        public OptionsChangedHandler(RedirectorManager redirectorManager, IOptionsMonitor <RedirectorResurceOptions> optionMonitor)
        {
            _redirectorManager = redirectorManager;
            _optionMonitor     = optionMonitor;

            optionMonitor.OnChange(onResourceChanged);
        }
Exemplo n.º 2
0
        public RedirectorMiddleware(RequestDelegate next,
                                    RedirectorManager redirectorManger,
                                    ILoggerFactory loggerFactory,
                                    IOptionsMonitor <RedirectorOptions> options)
        {
            if (next == null)
            {
                throw new ArgumentNullException("next");
            }

            if (options == null)
            {
                throw new ArgumentNullException("options");
            }

            _next = next;
            this.redirectorManger = redirectorManger;
            _options = options.CurrentValue;

            _logger = loggerFactory.CreateLogger <RedirectorMiddleware>();
        }