Beispiel #1
0
 public MongoDBConfigurationProvider(SharpSettingsMongoDataStore <TSettingsObject> store, string settingsId, bool reloadOnChange)
 {
     Store          = store;
     _settingsId    = settingsId;
     ReloadOnChange = reloadOnChange;
     if (ReloadOnChange)
     {
         _settingsWatcher = new SharpSettingsMongoSettingsWatcher <TSettingsObject>(Store, settingsId, settings => Data = GetProperties(settings).ToDictionary(x => x.Item1, x => x.Item2.ToString()));
     }
 }
Beispiel #2
0
        public UnitTest1(ITestOutputHelper testOutputHelper)
        {
            var logConfig = new LoggerConfiguration()
                            .WriteTo.TestOutput(testOutputHelper, LogEventLevel.Verbose)
                            .MinimumLevel.Verbose();

            Log.Logger = logConfig.CreateLogger();
            ILoggerFactory loggerFactory = new SerilogLoggerFactory(Log.Logger);

            _logger = loggerFactory.CreateLogger <UnitTest1>();
            _testSettingsDataStore = new SharpSettingsMongoDataStore <TestSettings>(Col, _logger);
        }
Beispiel #3
0
 public static IConfigurationBuilder AddMongoDBConfigProvider <TSettingsObject>(this IConfigurationBuilder builder, SharpSettingsMongoDataStore <TSettingsObject> store, string settingsId, bool reloadOnChange = true) where TSettingsObject : WatchableSettings <string>
 {
     return(builder.Add(new MongoDBConfigurationSource <TSettingsObject>(store, settingsId, reloadOnChange)));
 }
Beispiel #4
0
 public MongoDBConfigurationSource(SharpSettingsMongoDataStore <TSettingsObject> store, string settingsId, bool reloadOnChange)
 {
     Store          = store;
     SettingsId     = settingsId;
     ReloadOnChange = reloadOnChange;
 }