All;

.net, C#
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.

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nhusers/6f677a61-9d67-4cdd-8de1-7fa6e6acae4en%40googlegroups.com.

Reply via email to