这是将流畅的 nhibernate 转换为 xml 的有效方法吗?
Is this valid way to convert fluent nhibernate to xml?
我正在尝试转换此代码:
Component(x => x.User, x =>
{
x.References(m => m.UserAccount).Columns(@"UserAccountId", @"UserAccountType");
x.References(m => m.Postman, @"PostmanId");
});
回到 hbm.xml,我的问题是:我做的一切都很好还是我遗漏了什么?
转换后的代码:
<component name="User">
<many-to-one name="UserAccount">
<column name="UserAccountId"/>
<column name="UserAccountType"/>
</many-to-one>
<many-to-one name="Postman" column="PostmanId"></many-to-one>
</component>
如果需要,您可以将所有流畅的 nhibernate 映射输出为 xml。听起来比这容易多了。
Generate XML mappings from fluent Nhibernate
我正在尝试转换此代码:
Component(x => x.User, x =>
{
x.References(m => m.UserAccount).Columns(@"UserAccountId", @"UserAccountType");
x.References(m => m.Postman, @"PostmanId");
});
回到 hbm.xml,我的问题是:我做的一切都很好还是我遗漏了什么? 转换后的代码:
<component name="User">
<many-to-one name="UserAccount">
<column name="UserAccountId"/>
<column name="UserAccountType"/>
</many-to-one>
<many-to-one name="Postman" column="PostmanId"></many-to-one>
</component>
如果需要,您可以将所有流畅的 nhibernate 映射输出为 xml。听起来比这容易多了。
Generate XML mappings from fluent Nhibernate