C# Fluent Nhibernate和可插拔继承
是否有任何方法可以定义/扩展继承而不必使用Fluent NHibernate更改基表映射?例如,使用Castle.ActiveRecord(基于NHibernate),可以如下定义继承:C# Fluent Nhibernate和可插拔继承,c#,inheritance,nhibernate,fluent,C#,Inheritance,Nhibernate,Fluent,是否有任何方法可以定义/扩展继承而不必使用Fluent NHibernate更改基表映射?例如,使用Castle.ActiveRecord(基于NHibernate),可以如下定义继承: [ActiveRecord("entity"), JoinedBase] public class Entity : ActiveRecordBase { [PrimaryKey] public int Id { get; set; } } [ActiveRecord("entitycomp
[ActiveRecord("entity"), JoinedBase]
public class Entity : ActiveRecordBase
{
[PrimaryKey]
public int Id { get; set; }
}
[ActiveRecord("entitycompany")]
public class CompanyEntity : Entity
{
[JoinedKey("comp_id")]
public int CompId { get; set; }
}
- 可以在不更改基本实体映射的情况下添加或删除新的子类
- 调用
时,它将返回所有实体(以及继承的实体)Entity.FindAll()