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

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

            nhBootStrapper.eDirectorySchemaExport.Create(false, true);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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();
            }
        }