public LinqAggregates() { MongoConfiguration.RemoveMapFor <TestProduct>(); using (var session = new Session()) { session.Drop <TestProduct>(); } }
public void Mongo_Configuration_Can_Remove_Mapping() { MongoConfiguration.Initialize(r => r.For <User>(u => u.ForProperty(h => h.LastName).UseAlias("lName"))); //confirm that mapping was set. Assert.Equal("lName", MongoConfiguration.GetPropertyAlias(typeof(User), "LastName")); MongoConfiguration.RemoveMapFor <User>(); //confirm that mapping was unset. Assert.Equal("LastName", MongoConfiguration.GetPropertyAlias(typeof(User), "LastName")); }
public LinqDeepGraph() { MongoConfiguration.RemoveMapFor <TestProduct>(); MongoConfiguration.RemoveMapFor <Supplier>(); MongoConfiguration.RemoveMapFor <InventoryChange>(); MongoConfiguration.RemoveMapFor <Address>(); using (var session = new Session()) { session.Drop <TestProduct>(); } }
public MongoCollectionTests() { MongoConfiguration.RemoveMapFor <Address>(); MongoConfiguration.RemoveMapFor <TestProduct>(); MongoConfiguration.RemoveMapFor <IntId>(); using (var mongo = Mongo.Create(TestHelper.ConnectionString("strict=false"))) { mongo.Database.DropCollection("Fake"); mongo.Database.DropCollection("Faker"); } }
public MongoConfigurationTests() { MongoConfiguration.RemoveMapFor <User2>(); MongoConfiguration.RemoveMapFor <User>(); MongoConfiguration.RemoveMapFor <TestProduct>(); MongoConfiguration.RemoveMapFor <Shopper>(); MongoConfiguration.RemoveMapFor <Cart>(); MongoConfiguration.RemoveMapFor <TestProduct>(); MongoConfiguration.RemoveTypeConverterFor <NonSerializableValueObject>(); using (var admin = new MongoAdmin(TestHelper.ConnectionString())) { admin.DropDatabase(); } }
public void Mongo_Configuration_Remove_Mapping_Of_Norm_Types_Fails() { //removal of maps for Norm types is verboden. Assert.Throws <NotSupportedException>(() => MongoConfiguration.RemoveMapFor <IMongoDatabase>()); }