c# - How to get hold of the current NHibernate.Cfg.Configuration instance -


my c# project has repositories instantiated using dependency injection.

one of repository methods needs access nhibernate.cfg.configuration instance (to generate database schema) returned when initializing nhibernate.

i cannot pass configuration repository however, because break persistence ignorance principle -- don't want expose implementation details through repository interface.

so i'm looking way of getting hold of current nhibernate.cfg.configuration instance within repository. have no trouble getting hold of current session, it's configuration cannot hold of.

it not possible. sessionfactory not keep references configuration built it.

anyway, mauricio said: schema generation not repository concern.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -