public ServiceObservingOptions(IOptionsMonitor <ExampleConfig> options)
        {
            _options = options;

            _optionsMonitor = _options.OnChange(config =>
            {
                _config = config;
                Console.Write("Options monitor detected change.");
            });
            _config = _options.CurrentValue;
        }
Example #2
0
 private void UpdateConfig()
 {
     // the default anonymous option has an empty string as name
     _config = _optionsFactory.Create(string.Empty);
 }
Example #3
0
 public ServiceRequiringOptions(IOptions <ExampleConfig> options)
 {
     _config = options.Value;
 }