Impossible to provide a naming strategy

Promit Roy's Avatar

Promit Roy

15 Jul, 2010 08:08 PM via web

I need to determine some table names dynamically when the session factory is created. In normal NHibernate you can do this via Configuration.SetNamingStategy, but this has to be done before mappings are assigned. The way FluentConfiguration is set up makes this impossible; all configuration alterations are applied after mappings are set up. Right now I'm punching in via Reflection and setting the naming strategy before BuildConfiguration is called. I would much rather have a public API at hand to do this properly. (And yes, I probably should've built from source with necessary modifications.)

  1. Support Staff 2 Posted by James Gregory on 15 Jul, 2010 08:13 PM

    James Gregory's Avatar

    Fluently.Configure has an overload that takes a pre-initialized
    Configuration instance, can't you use that?

  2. 3 Posted by Promit Roy on 15 Jul, 2010 08:18 PM

    Promit Roy's Avatar

    Oh, maybe. Can I just pass it a blank Configuration with the naming strategy set?

  3. Support Staff 4 Posted by James Gregory on 15 Jul, 2010 08:22 PM

    James Gregory's Avatar

    Yep.

  4. 5 Posted by Promit Roy on 15 Jul, 2010 08:32 PM

    Promit Roy's Avatar

    One quick refactor later and everything looks good. Thanks!

Reply to this discussion

Preview Comments are parsed with Markdown. Help with syntax

Attached Files

    You can attach files up to 10MB

    What is fifteen divided by three?