c# - Fluent NHibernate Joined-Subclass 问题

标签 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();

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

最佳答案

从修订版 531 开始似乎已修复。

关于c# - Fluent NHibernate Joined-Subclass 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/882820/

相关文章:

c# - 如何使用 NHibernate 复制对象

C# NHibernate架构,三层应用

java - 多态性重载

swift - 覆盖 Swift 3 中的属性

c# - 为什么我的音频在Android版本(Unity3D)中失真

c# - 从 Entity Framework Core 中的导航属性选择对象列表

带有 Or 子查询的 NHibernate QueryOver

C# 与 dll 互操作

c# - 在任务中进行异步/等待数据库调用?

c# - InternalsVisibleTo 属性问题