Ejemplo n.º 1
0
 public IMongoDatabase GetDatabase(string name, MongoDatabaseSettings settings = null)
 {
     if (!databases.TryGetValue(name.ToLower(), out FakeMongoDatabase database))
     {
         databases.Add(name.ToLower(), database = new FakeMongoDatabase(this, name, settings));
     }
     return(database);
 }
Ejemplo n.º 2
0
 public FakeMongoCollection(FakeMongoDatabase database, string name, MongoCollectionSettings settings)
 {
     this.database       = database ?? throw new ArgumentNullException(nameof(database));
     Settings            = settings ?? throw new ArgumentNullException(nameof(settings));
     CollectionNamespace = new CollectionNamespace(database.DatabaseNamespace, name);
     DocumentSerializer  = BsonSerializer.LookupSerializer <TDocument>();
     indexManager        = new FakeMongoIndexManager <TDocument>(this);
 }