Arn*_*psa 6 enums nhibernate-mapping fluent-nhibernate
阅读Jimmy Boggard的一些 帖子并想知道 - 如何用流利的nhibernate映射那些野兽到底是什么意思?
映射如何看起来像这样?
public class EmployeeType : Enumeration{
public static readonly EmployeeType
Manager = new EmployeeType(0, "Manager"),
Servant = new EmployeeType(1, "Servant"),
AssistantToTheRegionalManager = new EmployeeType
(2, "Assistant to the Regional Manager");
private EmployeeType() { }
private EmployeeType(int value, string displayName) :
base(value, displayName) { }
}
Run Code Online (Sandbox Code Playgroud)
啊……这很容易。在 CodeCampServer 中 - 有一个通用的 EnumerationType 类。想法很简单 - 我们只需要使用 EnumerationType 包装域模型枚举值对象,以便将其映射为整数(或其他任何必要的值)。
| 归档时间: |
|
| 查看次数: |
1243 次 |
| 最近记录: |