0
我有一個類Project
和類Case
,它繼承自Project
。 當我們有一個Projects
的列表時,我們可能稍後決定將Case
作爲選中的Project
。我怎樣才能做到這一點?如何在使用ActiveRecord時將類轉換爲繼承類
項目:
[ActiveRecord (Table = "projects", Lazy = true), JoinedBase]
public class Project : ActiveRecordValidationBase<Project>
{
private int _id;
[PrimaryKey(PrimaryKeyType.Identity, "id")]
public virtual int Id
{
get { return _id; }
set { _id = value; }
}
}
案例:
[ActiveRecord(Table = "cases", Lazy = true)]
public class Case : Project
{
private int _caseId;
[JoinedKey("case_id")]
public virtual int CaseId
{
get { return _caseId; }
set { _caseId = value; }
}
}
我希望我的題目和問題是明確的:)