I’m using an NHibernateProvider library I found online, and I want to keep security and profile information separate from a collection of application databases I’m using; I intend to centralize the application services, but most applications will have their own database.
Googling nhibernate with multiple databases generates a long list of shockingly complicated processes. I thought it would be simpler if I hardcoded a reference to nhibernateprovider.config and reference only that in the provider library to avoid any issues with potential conflicts with core applications also using nhibernate. It seemed like a really simple idea, and I like simple… however, I cannot figure out any place to specify a configuration file when instantiating my session factory. Googling generates too many unrelated hits.
- Is it possible to explicitly specify a configuration file when instantiating a session factory, and if so,
- How do you do it?
- If it isn’t possible, why the heck not? This seems to be an obvious thing.
you can also share common information in the configfile and set the connectionstring dynamically befor constructing the sessionfactory