protected override void AdjustConfiguration(NHibernate.Cfg.Configuration cfg)
 {
     /*
      * NHibernate.Context.CallSessionContext
      * NHibernate.Context.ManagedWebSessionContext
      * NHibernate.Context.MapBasedSessionContext
      * NHibernate.Context.ReflectiveHttpContext
      * NHibernate.Context.ThreadLocalSessionContext
      * NHibernate.Context.ThreadStaticSessionContext
      * NHibernate.Context.WcfOperationSessionContext
      * NHibernate.Context.WebSessionContext
      */
     cfg.CurrentSessionContext<ThreadStaticSessionContext>();
 }
Пример #2
0
        protected virtual void RegisterProperties(NHibernate.Cfg.Configuration configuration)
        {
            configuration.Proxy(p => p.ProxyFactoryFactory<ComponentProxyFactoryFactory>());
            configuration.DataBaseIntegration(db =>
            {
                db.Dialect<MsSql2005Dialect>();
                db.Driver<SqlClientDriver>();
                //db.ConnectionStringName = "ConnectionString";
                db.ConnectionString = Common.Constants.AppConfig.ConnectionString;
                db.BatchSize = 10;
            });
            configuration.CurrentSessionContext<ThreadLocalConversationalSessionContext>();

            configuration.Cache(cp =>
            {
                cp.UseQueryCache = true;
                cp.Provider<SysCacheProvider>();
            });
        }