Ejemplo n.º 1
0
        private static void SetupInMemoryDatabase(ISessionCache cache, IDbConnection conn)
        {
            var fact = SessionFactoryManager.GetSessionFactory(cache.GetEnvironment());
            cache.SetSessionFactory(fact);

            UseSessionFactoryFromApplicationOrSessionCache(cache);
            var session = ObjectFactory.GetInstance<ISessionFactory>().OpenSession(conn);

            SessionFactoryManager.BuildSchema(cache.GetEnvironment(), session);
            CurrentSessionContext.Bind(session);

            UserServices.ConfigureSystemUser();
        }
Ejemplo n.º 2
0
 private static void UseSessionFactoryFromApplicationOrSessionCache(ISessionCache cache)
 {
     if (cache.GetSessionFactory() == null)
         ObjectFactory.Configure(
             x =>
             x.For<ISessionFactory>().Use(GenFormApplication.GetSessionFactory(cache.GetEnvironment())));
     else
     {
         ObjectFactory.Configure(
             x =>
             x.For<ISessionFactory>().Use(cache.GetSessionFactory));
     }
 }
Ejemplo n.º 3
0
 private static void SetupConfiguration(ISessionCache cache)
 {
     var environment = cache.GetEnvironment();
     var envConf = ConfigurationManager.Instance.GetConfiguration(environment);
     envConf.GetConnection();
 }