Ejemplo n.º 1
0
        public InMemoryCollection(IMongoDatabase db, VanillaCollection vCol, IFilter whereFilter, IUpdater updater)
        {
            Database         = db ?? throw new ArgumentNullException(nameof(db));
            this.vCol        = vCol ?? throw new ArgumentNullException(nameof(vCol));
            this.whereFilter = whereFilter ?? throw new ArgumentNullException(nameof(whereFilter));
            this.updater     = updater ?? throw new ArgumentNullException(nameof(updater));
            var map = BsonClassMap.LookupClassMap(typeof(T));

            idGenerator    = (idMemeber = map.IdMemberMap)?.IdGenerator;
            bsonSerializer = BsonSerializer.SerializerRegistry.GetSerializer <T>();
        }
Ejemplo n.º 2
0
 public InMemoryFilteredCollection(IMongoDatabase db, VanillaCollection vCol, IFilter whereFilter, IUpdater updater, FilterDefinition <TDerivedDocument> filterDefinition)
     : base(db, vCol, whereFilter, updater)
 {
     Filter = filterDefinition;
 }