How can I map Nullable Enum property on an entity to database int field that allows null?
I have this but it doesn't work:
<property name="ItemType" type="Int32" column="ItemType" not-null="false" />
When the entity is queried/being hydrated, it will throw:
Invalid Cast (check your mapping for property type mismatches); setter of PrlSystems.AccountingLibrary.Model.Item
Interestingly, if the ItemType property would not be nullable type, this mapping works fine.
Also, I am using nullables for DateTime, and other build in types, and it works fine. I just map these to their corresponding types.