Configure NHibernate using the <hibernate-configuration> section from the application config file, if found, or the file hibernate.cfg.xml otherwise.

Namespace:  NHibernate.Cfg
Assembly:  NHibernate (in NHibernate.dll)

Syntax

Visual Basic (Declaration)
Public Function Configure As Configuration
C#
public Configuration Configure()
Visual C++
public:
Configuration^ Configure()
JavaScript
function configure();

Return Value

A configuration object initialized with the file.

Remarks

To configure NHibernate explicitly using hibernate.cfg.xml, ignoring the application configuration file, use this code:
 Copy Code
            	configuration.Configure("path/to/hibernate.cfg.xml");
            

See Also