流畅的NHibernate加入子类问题

时间:2009-05-19 13:39:08

标签: c# nhibernate inheritance fluent-nhibernate

我有这个班级

public class Address:Entity {
    public virtual string Address1 { get; set; }
    public virtual string Address2 { get; set; }
    public virtual string City { get; set; }
    public virtual string State { get; set; }
    public virtual string Zip { get; set; }
    public virtual string Phone { get; set; }
    public virtual string Fax { get; set; }
    public virtual string TaxId { get; set; }
}

作为

的基类
public class Location:Address {
    public virtual string OfficeHours { get; set; }
    public virtual string PatientAgeRestrictions { get; set; }
    public virtual bool WheelchairAccess { get; set; }
    public virtual string ContactPerson { get; set; }
}

然后我用它来构建我的架构。

Fluently.Configure()
.Mappings(m => {
    m.AutoMappings.Add(
        AutoPersistenceModel.MapEntitiesFromAssemblyOf<Provider>()
        .Where(t => t.Namespace == "Entities")
        .ConventionDiscovery.AddFromAssemblyOf<UnderscoreIdDelimiter>()
        .WithSetup(s => {
            s.IsBaseType =
                type => type == typeof(Credentialing.Data.Entity);
        })
    );
})
.ExposeConfiguration(BuildSchema)
.BuildSessionFactory();

当我这样做时,列命名和表命名的约定不会应用于我的位置表。我错过了什么?

1 个答案:

答案 0 :(得分:0)

自修订版531起似乎已修复。