讀someposts來自Jimmy Boggard和想知道 - 如何映射這些野獸與流利的nhibernate?自定義枚舉類與流利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) { }
}
+1謝謝,對於任何需要它的人,您可以在這裏找到它:http://code.google.com/p/codecampserver/source/browse/trunk/src/Infrastructure/EnumerationType.cs – rohancragg 2009-11-30 14:50:43
此鏈接是無效。 http://code.google.com/p/codecampserver/source/browse/trunk/src/Infrastructure.NHibernate/DataAccess/EnumerationType.cs?spec=svn1063&r=1063 – 2010-01-04 04:10:02
感謝您修復它。他們稍微改變了項目結構。 – 2010-01-04 06:35:00