Here is a small VS 2010 solution with a single failing test that replicates the following issue.
I have a convention UserTypeConvention<MyUserType>
where MyUserType : IUserType
where MyUserType
handles an enum type MyEnum
. I have configured Fluent NHibernate thusly
sessionFactory = Fluently
.Configure()
.Database(MsSqlConfiguration.MsSql2005.ConnectionString(
c => c.Is(connectionString))
)
.Mappings(
m => m
.FluentMappings
.AddFromAssemblyOf<A>()
.Conventions
.AddFromAssemblyOf<A>()
)
.BuildSessionFactory();
where A
is a type in the same assembly as UserTypeConvention<MyUserType>
and MyUserType
. However, Fluent NHibernate is not applying MyUserType
to properties of type MyEnum
on my domain objects. Instead, it is applying FluentNHibernate.Mapping.GenericEnumMapper<MyEnumType>
to these properties.
What is going on?