コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MongoDbConfigurationProvider"/> class.
 /// </summary>
 /// <param name="options">The options.</param>
 public MongoDbConfigurationProvider(MongoDbConfigOptions options)
 {
     _connectionString = options.ConnectionString;
     _database         = options.DatabaseName;
     _collectionToUse  = options.CollectionName;
     _readMode         = options.ReadOption;
     _keysToRead       = options.KeysToRead;
     _itemsCollection  = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase);
     _runInQueryMode   = options.QueryInFilteredMode;
     _keyToMatch       = options.KeyToQuery;
     _valueToMatch     = options.ValueToMatch;
     _token            = new ConfigurationReloadToken();
 }
コード例 #2
0
 /// <summary>
 /// Adds the mongo database configuration.
 /// </summary>
 /// <param name="builder">The builder.</param>
 /// <param name="setup">The setup.</param>
 /// <returns>IConfigurationBuilder.</returns>
 public static IConfigurationBuilder AddMongoDbConfiguration(this IConfigurationBuilder builder,
                                                             MongoDbConfigOptions setup)
 {
     return
         (builder.Add(new MongoDbConfigurationSource(setup)));
 }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MongoDbConfigurationSource"/> class.
 /// </summary>
 /// <param name="options">The options.</param>
 public MongoDbConfigurationSource(MongoDbConfigOptions options)
 {
     _options = options;
 }