本文整理汇总了C#中NHibernate.Mapping.ByCode.ExplicitlyDeclaredModel.IsPersistentProperty方法的典型用法代码示例。如果您正苦于以下问题:C# ExplicitlyDeclaredModel.IsPersistentProperty方法的具体用法?C# ExplicitlyDeclaredModel.IsPersistentProperty怎么用?C# ExplicitlyDeclaredModel.IsPersistentProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NHibernate.Mapping.ByCode.ExplicitlyDeclaredModel
的用法示例。
在下文中一共展示了ExplicitlyDeclaredModel.IsPersistentProperty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WhenPropertyUsedAsComposedIdThenRegister
public void WhenPropertyUsedAsComposedIdThenRegister()
{
var inspector = new ExplicitlyDeclaredModel();
var mapper = new ModelMapper(inspector);
mapper.Class<MyClass>(map => map.ComponentAsId(x => x.Id));
inspector.IsPersistentId(For<MyClass>.Property(x => x.Id)).Should().Be.True();
inspector.IsPersistentProperty(For<MyClass>.Property(x => x.Id)).Should().Be.True();
inspector.IsComponent(typeof(IMyCompo)).Should().Be.True();
}
示例2: WhenPropertyUsedAsComposedIdThenRegister
public void WhenPropertyUsedAsComposedIdThenRegister()
{
var inspector = new ExplicitlyDeclaredModel();
var mapper = new ModelMapper(inspector);
mapper.Class<MyClass>(map =>
map.ComposedId(cm=>
{
cm.Property(x => x.Code);
cm.ManyToOne(x => x.Relation);
})
);
inspector.IsMemberOfComposedId(For<MyClass>.Property(x => x.Code)).Should().Be.True();
inspector.IsMemberOfComposedId(For<MyClass>.Property(x => x.Relation)).Should().Be.True();
inspector.IsPersistentProperty(For<MyClass>.Property(x => x.Code)).Should().Be.True();
inspector.IsPersistentProperty(For<MyClass>.Property(x => x.Relation)).Should().Be.True();
inspector.IsPersistentId(For<MyClass>.Property(x => x.Code)).Should().Be.False();
inspector.IsPersistentId(For<MyClass>.Property(x => x.Relation)).Should().Be.False();
}