Another common way to configure NHibernate is to put the configuration into an XML file. This is really simple, as it follows the exact same format as the App.config
/Web.config
files. All you have to do is create an XML file in your application and add the same settings that you would add to the App.config
file.
<?xml version="1.0" encoding="utf-8" ?> <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"> <session-factory> <property name="connection.provider"> NHibernate.Connection.DriverConnectionProvider </property> <property name="dialect"> NHibernate.Dialect.MsSql2008Dialect </property> <property name="connection.connection_string_name"> Ordering </property> <property name="proxyfactory.factory_class"> NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu </property> <mapping assembly="Ordering.Data"/> ...