当前位置: 首页>>代码示例>>C#>>正文


C# ByCode.SimpleModelInspector类代码示例

本文整理汇总了C#中NHibernate.Mapping.ByCode.SimpleModelInspector的典型用法代码示例。如果您正苦于以下问题:C# SimpleModelInspector类的具体用法?C# SimpleModelInspector怎么用?C# SimpleModelInspector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SimpleModelInspector类属于NHibernate.Mapping.ByCode命名空间,在下文中一共展示了SimpleModelInspector类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WhenReadonlyNotDeclaredThenIsNotPersistentProperty

		public void WhenReadonlyNotDeclaredThenIsNotPersistentProperty()
		{
			var autoinspector = new SimpleModelInspector();
			var inspector = (IModelInspector)autoinspector;

			inspector.IsPersistentProperty(typeof(MyEntity).GetProperty("ReadOnly")).Should().Be.False();
		}
开发者ID:NikGovorov,项目名称:nhibernate-core,代码行数:7,代码来源:PropertiesExclusionTests.cs

示例2: WhenReadonlyNotDeclaredThenIsNotPersistentProperty

		public void WhenReadonlyNotDeclaredThenIsNotPersistentProperty()
		{
			var autoinspector = new SimpleModelInspector();
			var inspector = (IModelInspector)autoinspector;

			Assert.That(inspector.IsPersistentProperty(typeof(MyEntity).GetProperty("ReadOnly")), Is.False);
		}
开发者ID:marchlud,项目名称:nhibernate-core,代码行数:7,代码来源:PropertiesExclusionTests.cs

示例3: ByDefaultInheritedFromObject

		public void ByDefaultInheritedFromObject()
		{
			var autoinspector = new SimpleModelInspector();
			var inspector = (IModelInspector)autoinspector;

			Assert.That(inspector.IsRootEntity(typeof(Person)), Is.True);
			Assert.That(inspector.IsRootEntity(typeof(Product)), Is.False);
		}
开发者ID:marchlud,项目名称:nhibernate-core,代码行数:8,代码来源:RootEntityTests.cs

示例4: IncludesReadOnlyWithField

		public void IncludesReadOnlyWithField()
		{
			var autoinspector = new SimpleModelInspector();
			var inspector = (IModelInspector)autoinspector;
			
			PropertyInfo pi = typeof(MyEntity).GetProperty("NoReadOnlyWithField");
			inspector.IsPersistentProperty(pi).Should().Be.True();
		}
开发者ID:NikGovorov,项目名称:nhibernate-core,代码行数:8,代码来源:PropertiesExclusionTests.cs

示例5: MatchWithCollectionPropertyAndArrayField

		public void MatchWithCollectionPropertyAndArrayField()
		{
			var mi = typeof(Entity).GetProperty("Emails");
			var autoinspector = new SimpleModelInspector();
			var inspector = (IModelInspector)autoinspector;

			Assert.That(inspector.IsArray(mi), Is.True);
		}
开发者ID:marchlud,项目名称:nhibernate-core,代码行数:8,代码来源:ArrayCollectionTests.cs

示例6: WhenRelationWithTwoEntityThenIsManyToOne

		public void WhenRelationWithTwoEntityThenIsManyToOne()
		{
			var autoinspector = new SimpleModelInspector();
			autoinspector.IsEntity((t, declared) => typeof(AEntity).Equals(t) || typeof(BEntity).Equals(t));

			var inspector = (IModelInspector)autoinspector;
			Assert.That(inspector.IsManyToOne(typeof(AEntity).GetProperty("B")), Is.True);
		}
开发者ID:marchlud,项目名称:nhibernate-core,代码行数:8,代码来源:ManyToOneTest.cs

示例7: WhenSimplePropertyThenIsNotManyToOne

		public void WhenSimplePropertyThenIsNotManyToOne()
		{
			var autoinspector = new SimpleModelInspector();
			autoinspector.IsEntity((t, declared) => typeof(AEntity).Equals(t) || typeof(BEntity).Equals(t));

			var inspector = (IModelInspector)autoinspector;
			Assert.That(inspector.IsManyToOne(typeof(AEntity).GetProperty("Name")), Is.False);
		}
开发者ID:marchlud,项目名称:nhibernate-core,代码行数:8,代码来源:ManyToOneTest.cs

示例8: NotMatchWithByteArrayProperty

		public void NotMatchWithByteArrayProperty()
		{
			var mi = typeof(Entity).GetProperty("Bytes");
			var autoinspector = new SimpleModelInspector();
			var inspector = (IModelInspector)autoinspector;

			inspector.IsBag(mi).Should().Be.False();
		}
开发者ID:Ruhollah,项目名称:nhibernate-core,代码行数:8,代码来源:BagCollectionTests.cs

示例9: MatchWithSetProperty

		public void MatchWithSetProperty()
		{
			var mi = typeof(EntityWithSets).GetProperty("NickNames");
			var autoinspector = new SimpleModelInspector();
			var inspector = (IModelInspector)autoinspector;

			inspector.IsSet(mi).Should().Be.True();
		}
开发者ID:NikGovorov,项目名称:nhibernate-core,代码行数:8,代码来源:SetCollectionTests.cs

示例10: NotMatchWithByteArrayProperty

		public void NotMatchWithByteArrayProperty()
		{
			var mi = typeof(Entity).GetProperty("Bytes");
			var autoinspector = new SimpleModelInspector();
			var inspector = (IModelInspector)autoinspector;

			Assert.That(inspector.IsBag(mi), Is.False);
		}
开发者ID:marchlud,项目名称:nhibernate-core,代码行数:8,代码来源:BagCollectionTests.cs

示例11: WhenNotExplicitlyDeclaredThenNoMatchPropertiesOutOfDefaultDelegate

		public void WhenNotExplicitlyDeclaredThenNoMatchPropertiesOutOfDefaultDelegate()
		{
			var autoinspector = new SimpleModelInspector();

			var inspector = (IModelInspector)autoinspector;
			inspector.IsPersistentId(typeof(TestEntity).GetProperty("testEntityId")).Should().Be.False();
			inspector.IsPersistentId(typeof(TestEntity).GetProperty("Something")).Should().Be.False();
		}
开发者ID:Ruhollah,项目名称:nhibernate-core,代码行数:8,代码来源:PoidTests.cs

示例12: MatchWithArrayProperty

		public void MatchWithArrayProperty()
		{
			var mi = typeof(Entity).GetProperty("NickNames");
			var autoinspector = new SimpleModelInspector();
			var inspector = (IModelInspector)autoinspector;

			Assert.That(inspector.IsArray(mi), Is.True);
		}
开发者ID:marchlud,项目名称:nhibernate-core,代码行数:8,代码来源:ArrayCollectionTests.cs

示例13: NotMatchWithCollectionProperty

		public void NotMatchWithCollectionProperty()
		{
			var mi = typeof(Entity).GetProperty("Others");
			var autoinspector = new SimpleModelInspector();
			var inspector = (IModelInspector)autoinspector;

			Assert.That(inspector.IsArray(mi), Is.False);
		}
开发者ID:marchlud,项目名称:nhibernate-core,代码行数:8,代码来源:ArrayCollectionTests.cs

示例14: NotMatchWithCollectionField

		public void NotMatchWithCollectionField()
		{
			var mi = typeof(EntityWithSets).GetField("others", BindingFlags.NonPublic | BindingFlags.Instance);
			var autoinspector = new SimpleModelInspector();
			var inspector = (IModelInspector)autoinspector;

			inspector.IsSet(mi).Should().Be.False();
		}
开发者ID:NikGovorov,项目名称:nhibernate-core,代码行数:8,代码来源:SetCollectionTests.cs

示例15: NotMatchWithCollectionProperty

		public void NotMatchWithCollectionProperty()
		{
			var mi = typeof(EntityWithSets).GetProperty("Others");
			var autoinspector = new SimpleModelInspector();
			var inspector = (IModelInspector)autoinspector;

			inspector.IsSet(mi).Should().Be.False();
		}
开发者ID:NikGovorov,项目名称:nhibernate-core,代码行数:8,代码来源:SetCollectionTests.cs


注:本文中的NHibernate.Mapping.ByCode.SimpleModelInspector类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。