3
如何寫新的NHibernate映射-BY-代碼映射表每個子類戰略本類:表每個子類繼承映射的NHibernate的映射,由碼
public class Person
{
public virtual int Id { get; set; }
public virtual string Name { get; set; }
}
public class JuridicalPerson : Person
{
public virtual int Id { get; set; }
public virtual string LegalName { get; set; }
}
public class PrivatePerson : Person
{
public virtual int Id { get; set; }
public virtual bool Sex { get; set; }
}
看看這裏:http://notherdev.blogspot.com/2012/01/mapping-by-code-inheritance.html所有與代碼映射相關的繼承選項。 – NOtherDev 2012-02-05 15:48:39