Ejemplo n.º 1
0
        private static void SetSessionFactory()
        {
#if FLUENTSQLITE
            SessionFactory = new SQLiteFluentSessionFactoryBuilder().BuildSessionFactory();
#elif FLUENTSQLSERVER
            SessionFactory = new SqlServerFluentSessionFactoryBuilder().BuildSessionFactory();
#elif HBMSQLSERVER
            SessionFactory = new SqlServerHbmSessionFactoryBuilder().BuildSessionFactory();
#else
            SessionFactory = new SQLiteHbmSessionFactoryBuilder().BuildSessionFactory();
#endif
        }
Ejemplo n.º 2
0
        static Fixture()
        {
            log4net.Config.XmlConfigurator.Configure();
            Logger = LogManager.GetLogger(typeof(Fixture));

            #if FLUENTSQLITE
            SessionFactory = new SQLiteFluentSessionFactoryBuilder().BuildSessionFactory();
            #else
            SessionFactory = new SQLiteHbmSessionFactoryBuilder().BuildSessionFactory();
            #endif

            //HibernatingRhinos.Profiler.Appender.NHibernate.NHibernateProfiler.Initialize();

            using (var session = CreateSession())
            using (var transaction = session.BeginTransaction())
            {
                TestData.Create(session);
                transaction.Commit();
            }
        }