private ISessionFactory InitializeSessionFactory()
        {
            var nhConfiguration = new NhBootStrapper {
                ConfigurationFileName = Translate(ConfigurationFileName)
            };

            return(nhConfiguration.NhConfiguration.BuildSessionFactory());
        }
Beispiel #2
0
        public void ConfigureStore()
        {
            var nhBootStrapper = new NhBootStrapper {
                ConfigurationFileName = _configurationName
            };

            nhBootStrapper.eDirectorySchemaExport.Create(false, true);
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            var nhBootStrapper = new NhBootStrapper
            {
                ConfigurationFileName = @"nhibernate.ce.console.cfg.xml"
            };

            var connString = nhBootStrapper.NhConfiguration.GetProperty("connection.connection_string");

            System.Console.WriteLine("Updating database schema for: " + connString);
            nhBootStrapper.eDirectorySchemaExport.Create(true, true);
        }
Beispiel #4
0
        private static void InitialiseDatabase()
        {
            var nHFactory = GlobalContext.Instance().TransFactory as TransManagerFactoryNh;

            if (nHFactory == null)
            {
                return;
            }
            var nhBootStrapper = new NhBootStrapper {
                ConfigurationFileName = nHFactory.ConfigurationFileName
            };

            nhBootStrapper.eDirectorySchemaExport.Create(false, true);
        }
Beispiel #5
0
        private static void InitialiseDatabase()
        {
            var nHFactory = GlobalContext.Instance().TransFactory as TransManagerFactoryNh;

            if (nHFactory == null)
            {
                return;
            }
            var nhBootStrapper = new NhBootStrapper {
                ConnectionString = ApplicationSettingsFactory.ConnectionString
            };
            bool CreateDatabase = bool.Parse(ApplicationSettingsFactory.CreateDB);

            if (CreateDatabase)
            {
                nhBootStrapper.CamsSchemaExport();
            }
        }