Reading some posts from Jimmy Boggard and wondering - how exactly is it possible to map those beasts with fluent nhibernate?
How mapping would look like for this?
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) { }
}
Ah... it was easy. In CodeCampServer - there's a generic EnumerationType class. Idea is simple - we just need to wrap our domain model enumeration value object with EnumerationType in order to map it as integer (or anything else if necessary).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With