コード例 #1
0
ファイル: LinqAggregates.cs プロジェクト: zulkamal/NoRM
 public LinqAggregates()
 {
     MongoConfiguration.RemoveMapFor <TestProduct>();
     using (var session = new Session())
     {
         session.Drop <TestProduct>();
     }
 }
コード例 #2
0
        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"));
        }
コード例 #3
0
 public LinqDeepGraph()
 {
     MongoConfiguration.RemoveMapFor <TestProduct>();
     MongoConfiguration.RemoveMapFor <Supplier>();
     MongoConfiguration.RemoveMapFor <InventoryChange>();
     MongoConfiguration.RemoveMapFor <Address>();
     using (var session = new Session())
     {
         session.Drop <TestProduct>();
     }
 }
コード例 #4
0
ファイル: MongoCollectionTests.cs プロジェクト: zulkamal/NoRM
        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");
            }
        }
コード例 #5
0
        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();
            }
        }
コード例 #6
0
 public void Mongo_Configuration_Remove_Mapping_Of_Norm_Types_Fails()
 {
     //removal of maps for Norm types is verboden.
     Assert.Throws <NotSupportedException>(() => MongoConfiguration.RemoveMapFor <IMongoDatabase>());
 }