My C # project has repositories that are created using dependency injection.
One of the repository methods needs access to the instance of NHibernate.Cfg.Configuration (to create the database schema) that was returned during NHibernate initialization.
I cannot transfer the configuration to the repository because it violates the principle of ignorance of persistence - I really do not want to disclose any implementation details through the repository interface.
So I'm looking for a way to get the current instance of NHibernate.Cfg.Configuration from my repository. I have no problem getting the current session, it's just a configuration that I cannot get.
source share