【发布时间】:2009-05-19 13:39:07
【问题描述】:
我有这门课
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();
当我这样做时,列命名和表命名的约定不会应用于我的位置表。我错过了什么?
【问题讨论】:
-
您最后一次更新源是什么时候?
-
我认为我们的版本是 488,这是一个已知问题吗?我最终只是改变了我尝试这样做的方式,但在我得到答案的情况下留下了问题。
标签: c# nhibernate inheritance fluent-nhibernate