private void init()
{
IoCFactory.StartContainer(Path.Combine(AppConfiguration.AppRoot, "IoC.config"), "DefaultContainer"); // use AppConfig to access the app root folder
loadModules();
IPersistenceManager pManager = PersistenceFactory.GetPersistenceManager(); // just to prepare data access environment
pManager.Configure(AppConfiguration.DefaultApplicationConnection.ConnectionString, AppConfiguration.DatabaseDialect, "Default", AppConfiguration.ShowQueries);
if (AppConfiguration.CreateDatabase)
pManager.ExportSchema();
pManager.Start();
//pManager.UpdateSchema(true, true); // seems NH has dropped the support for schema update!
#if DEBUG
//HibernatingRhinos.Profiler.Appender.NHibernate.NHibernateProfiler.Initialize();
//just for testing purposes
#endif
}