Please forgive me if the answer to this should be obvious from the
docs.

I'm using AutoMapping w/ conventions, and I have an override class.
The case I'm asking about happens to be re: StringLength but I'm
hoping the idea should be applicable to any convention.

Convention class
------------------------
public class DefaultStringLengthConvention: IPropertyConvention
    {
        public bool Accept(IProperty property) { return true; }

        public void Apply(IProperty property) { property.WithLengthOf
(50); }
    }

Override
-----------------
        public void Override(AutoMap<User> mapping) {
            mapping.Map(x => x.Email).WithLengthOf(30);
        }

FNH looks at the override class before the convention, which explains
why the generated ddl for Email.StringLength winds up being 50 instead
of 30; so I'm guessing I need some logic in Accept() to deal with
this.

Is that the case?

Thx!
Berryl

--~--~---------~--~----~------------~-------~--~----~
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