public EtcdConfigurationProvider(IConfigrationRepository configRepository, bool reloadOnChange, Action <IConfigurationRoot> actionOnChange) { _configRepository = configRepository; _actionOnChange = actionOnChange; if (reloadOnChange || actionOnChange != null) { _configRepository.Watch(this); } }
public EtcdConfigurationProvider(IConfigrationRepository configRepository, bool reloadOnChange) { _configRepository = configRepository; if (reloadOnChange) { _configRepository.Watch(this); ChangeToken.OnChange( () => GetReloadToken(), () => Load() ); } }