【发布时间】:2011-06-05 17:40:32
【问题描述】:
我是 EF4 CTP5 的新手,我想在下面创建一个模型,每个表都是相同的字段(id、文本、值),我不想把它们都放在一个表中,我可以使用基类吗?但我不知道我的域模型如何?
public class BaseSearchType
{
public int Id {get;set;}
public int text{get;set;}
public int value {get;set;}
}
public class BooleanSearchTypeTable :BaseSearchType
{
}
public class JobStatusSearchTypeTable:BaseSearchType
{
}
public class PersonStatusSearchTypeTable: BaseSearchType
{
}
表格
BooleanSearchTypeTable
-----------------
id text value
1 All 0
2 Yes 1
3 No 2
JobStatusSearchTypeTable
-----------------
id text value
1 Open 0
2 Closed 1
3 Approved 2
4 Rejected 3
5 Waiting 4
PersonStatusSearchTypeTable
id text value
1 Work 0
2 Seek 1
3 Vacation 2
【问题讨论】:
-
您应该升级到发布版本。已经出了一个多月了。英孚 4.1
标签: c# entity-framework entity-framework-4 entity-framework-4.1 ef-code-first