Is it possible to map an enum as a string using Fluent Nhibernate?
Yes, it does that by default if you just do:
Map(x => x.YourProperty);
Make sure you're using the latest version off the trunk.
As Yavor Shahpasov pointed out in the comments, in more recent versions you can accomplish the same with:
Map(x => x.Property).CustomType<GenericEnumMapper<YourPropertyEnumType>>();
and there is also the EnumString class you can pass as customType
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