public EtcdConfigurationProvider(IConfigrationRepository configRepository, bool reloadOnChange, Action <IConfigurationRoot> actionOnChange)
        {
            _configRepository = configRepository;
            _actionOnChange   = actionOnChange;

            if (reloadOnChange || actionOnChange != null)
            {
                _configRepository.Watch(this);
            }
        }
예제 #2
0
        public EtcdConfigurationProvider(IConfigrationRepository configRepository, bool reloadOnChange)
        {
            _configRepository = configRepository;

            if (reloadOnChange)
            {
                _configRepository.Watch(this);

                ChangeToken.OnChange(
                    () => GetReloadToken(),
                    () => Load()
                    );
            }
        }