private IMongoCollection <T> GetCollection <T>() { var client = new InMemoryClient(); var db = client.GetDatabase("test"); var col = db.GetCollection <T>(typeof(T).Name); return(col); }
private IMongoCollection <MyEntity> GetCollection(params MyEntity [] entities) { var client = new InMemoryClient(); var db = client.GetDatabase("test"); var col = db.GetCollection <MyEntity>("myEntities"); col.InsertMany(entities); return(col); }