Hello,
I'm having some issues trying to map an enum property using it's
integer value as opposed to the string value. Her's what I've got and
hopefully someone can tell me what I'm doing wrong. I'm using 1.0RTM
by the way.
First, I've got a class call EnumConvention that looks like this:
public class EnumConvention : IUserTypeConvention
{
public void Accept(IAcceptanceCriteria<IPropertyInspector> criteria)
{
criteria.Expect(x => x.Property.PropertyType.IsEnum);
}
public void Apply(IPropertyInstance instance)
{
instance.CustomType(instance.Property.PropertyType);
}
}
In my mapping file, I've got the following:
Map(x => x.QueueType, "queueTypeID").CustomType(typeof
(EnumConvention));
The hbm that is generated looks like this:
<property name="QueueType" type="RMS.Data.Conventions.EnumConvention,
RMS.Data, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
<column name="queueTypeID" />
</property>
NHibernate.MappingException: Could not determine type for:
TotalVisibility.RMS.Data.Helpers.EnumConvention,
TotalVisibility.RMS.Data, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null, for columns: NHibernate.Mapping.Column
(queueTypeID)
Am I missing something? I thought I followed all the steps.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Fluent NHibernate" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---