我有标准的一对多表设置,但我希望能够将它映射到类似这样的类结构:
Class 1 -> Mapped to Table 1 (The one- side of the one-to-many relationship) | --- Intermediary class that has additional methods on and has a List of Class 2 | ---- Class 2 -> Mapped to Table 2 (The -many side of the relationship)
NHibernate有可能吗?
答案 0 :(得分:0)
有可能例如
class Class1Map : ClassMap<Class1>
{
public Class1Map()
{
Id(x => x.Id);
Component(c =>
{
c.Map(x => x.Foo);
c.HasMany(x => x.Classes2);
});
}
}