title: How to get hold of the current NHibernate.Cfg.Configuration instance
body: <p>My C# project has repositories that are instantiated using dependency injection.</p>
  
  <p>One of the repository methods needs access to the <code>NHibernate.Cfg.Configuration</code> instance (to generate the database schema) that was returned when initializing NHibernate.</p>
  
  <p>I cannot pass the configuration to the repository however, because that would break the persistence ignorance principle -- I really don't want to expose any implementation details through the repository interface.</p>
  
  <p>So what I'm looking for is a way of getting hold of the current <code>NHibernate.Cfg.Configuration</code> instance from within my repository. I have no trouble getting hold of the current session, it's just the configuration that I cannot get hold of.</p>