I had the same problem yesterday
http://groups.google.com/group/fluent-nhibernate/browse_thread/thread/f04aa812687860bb#
Try this
public class EnumerationTypeShouldBeIntegerNotStringConvention
: IClassConvention, IConventionAcceptance<IClassInspector>
{
public void Accept(IAcceptanceCriteria<IClassInspector>
criteria)
{
criteria.Expect(x => x.GetType() == typeof(Enum));
}
void IConvention<IClassInspector, IClassInstance>.Apply
(IClassInstance instance)
{
instance.EntityType = typeof(int);
}
}
Documentation can be found here
http://wiki.fluentnhibernate.org/Conventions
and here
http://wiki.fluentnhibernate.org/Conventions#Conditional_applying_of_conventions
On 18 août, 16:29, Richard Evans <[email protected]> wrote:
> We've got a convention that I'd like to port to RC1. Any suggestions
> for the best way to migrate this?
>
> public class EnumerationTypeShouldBeIntegerNotStringConvention :
> IClassConvention
> {
> public bool Accept(IClassMap target)
> {
> return target.GetType() == typeof(Enum);
> }
>
> public void Apply(IClassMap target)
> {
> target.SetAttribute("type", "int");
> }
>
> }
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---