Ejemplo n.º 1
0
        private void Initialize()
        {
            var connStrBuilder = new System.Data.SqlClient.SqlConnectionStringBuilder
            {
                DataSource         = @"qa-db1",
                InitialCatalog     = "WertmanSandbox",
                IntegratedSecurity = true
            };

            // Chonfigure NH
            Config = new NHibernateConfig(connStrBuilder.ConnectionString);

            // Create database structure
            Config.UpdateDatabase(true);

            // Create test entries
            using (var s = Config.SessionFactory.OpenSession())
            {
                using (var tr = s.BeginTransaction())
                {
                    PopulateData(s);

                    tr.Commit();
                }
            }
        }
Ejemplo n.º 2
0
        private void Initialize()
        {
            var connStrBuilder = new System.Data.SqlClient.SqlConnectionStringBuilder
            {
                DataSource = @"dev13-don\SANDBOX",
                InitialCatalog = "NHHierarchy",
                IntegratedSecurity = true
            };

            // Chonfigure NH
            Config = new NHibernateConfig(connStrBuilder.ConnectionString);

            // Create database structure
            Config.UpdateDatabase(true);

            // Create test entries
            using (var s = Config.SessionFactory.OpenSession())
            {
                using (var tr = s.BeginTransaction())
                {
                    PopulateData(s);

                    tr.Commit();
                }
            }
        }
Ejemplo n.º 3
0
 public TestNHibernateRepository()
 {
     SessionFactoryHelper.SessionFactory   = NHibernateConfig.CreateSessionFactory();
     RepositoryContainerFactory.Repository = new NHibernateRepository(SessionFactoryHelper.SessionFactory);
 }