public MongoStorageProvider(
     ILogger <MongoStorageProvider <TValue> > logger,
     IOptions <MongoStoringOptions> options,
     IMongoClientFactory clientFactory,
     ISystemClock clock)
 {
     this.logger     = logger;
     this.options    = options.Value;
     this.collection = clientFactory.GetDatabase().GetCollection <MongoRecord>(this.options.SingleCollectionName);
     this.clock      = clock;
 }
예제 #2
0
        public MongoHistoricalStorageProvider(
            ILogger <MongoHistoricalStorageProvider <TValue> > logger,
            IOptions <MongoStoringOptions> options,
            IMongoClientFactory clientFactory,
            ISystemClock clock)
        {
            this.logger  = logger;
            this.options = options.Value;
            this.clock   = clock;

            var database = clientFactory.GetDatabase();

            this.keyCollection      = database.GetCollection <MongoKeyRecord>(this.options.KeyCollectionName);
            this.keyValueCollection = database.GetCollection <MongoKeyValueRecord>(this.options.KeyValueCollectionName);
            this.valueCollection    = database.GetCollection <MongoValueRecord>(this.options.ValueCollectionName);
        }