in NHibernate, the default mapping of an Enum is to an integer (at
least, I've never told it to do anything special, and it has always
mapped to my integer columns fine). In FluentNHibernate, the default
mapping is to a string, because of the GenericEnumMapper class:

namespace FluentNHibernate.Mapping
{
    public class GenericEnumMapper<TEnum> : EnumStringType
    {
        public GenericEnumMapper()
            : base(typeof (TEnum))
        {
        }
    }
}

the problem is the "EnumStringType" that's being inherited from.

I don't want to map enums to strings. I want to map them to integers,
because I use the enum integer value as a primary key in a relational
table, for data consistency and reporting purposes.

How do I tell FluentNHibernate to not map the enum as a string, but
map as an int? There is no "EnumIntType" to create a different enum
mapper, and when i pass in an empty string for the .CustomType of my
property, it throws an exception.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to fluent-nhibernate@googlegroups.com
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to