diff --git a/doc/reference/modules/configuration.xml b/doc/reference/modules/configuration.xml index bef10305634..8540764df70 100644 --- a/doc/reference/modules/configuration.xml +++ b/doc/reference/modules/configuration.xml @@ -433,6 +433,45 @@ var session = sessions.OpenSession(conn); + + Using a custom configuration provider + + + By default, NHibernate attempts to read the hibernate-configuration section + through the .Net ConfigurationManager. Some environments do not support it, so + NHibernate provides a way to set a custom configuration provider, through the + NHibernate.Cfg.ConfigurationProvider.Current property. + + + + To disable the configuration provider, in case you configure NHibernate entirely programmatically, + set this property to null. + + + + + + To provide directly the System.Configuration.Configuration instance to use, assign + the Current property with an instance of + NHibernate.Cfg.SystemConfigurationProvider built with your + Configuration instance. + + + + + + You may also derive a custom provider from NHibernate.Cfg.ConfigurationProvider, + implements its abstract methods, and assign an instance of your custom provider to the + NHibernate.Cfg.ConfigurationProvider.Current property. + + + + Changes of the ConfigurationProvider.Current property value are to be done very + early in the application lifecycle, before any other call on a NHibernate API. Otherwise they + may not be taken into account. + + + Optional configuration properties