IsEnum never true in conventions
I want to create a convention for all enums in my project. I tried the following but it doesn't work:
ConventionBuilder.Property.When(
c => c.Expect(x => x.Type.IsEnum),
x => x.CustomSqlType("text"))
I think this is because x.Type's inner type isn't my enum but GenericEnumMapper<MyEnum>
. But it needs to be directly an enum, otherwise innerType.IsEnum doesn't return true.
Is this a bug in FluentNHibernate or is there another way?
Comments are currently closed for this discussion. You can start a new one.
Support Staff 2 Posted by Paul Batum on 07 Aug, 2010 12:12 PM
I've implemented a fix for this. IsEnum will now return true in the
scenario you've described.
The fix should be in the trunk before too long, but until then you can
use GetUnderlyingSystemType() to get and the inner type and check it
as necessary.
3 Posted by cremor on 24 Aug, 2010 06:33 AM
Works, thanks.
cremor closed this discussion on 24 Aug, 2010 06:33 AM.