Hi,
using nhibernate, how would I setup a column to be an enumeration type?
e.g.
User class has UserType which is an enumeration
public enum UserType { Normal = 1, Super = 2 }
Hi,
using nhibernate, how would I setup a column to be an enumeration type?
e.g.
User class has UserType which is an enumeration
public enum UserType { Normal = 1, Super = 2 }
You don't build a map for the enum. You add the enum to a map on an object. Declare the type as the type of the enum. The column in the db needs to be an int, and NHib will map it properly.
See here in my answer.