Beispiel #1
0
        public override void Init()
        {
            base.Init();

            // The WebSessionStorage must be created during the Init() to tie in HttpApplication events
            webSessionStorage = new WebSessionStorage(this);
        }
        public override void Init()
        {
            base.Init();

            // The WebSessionStorage must be created during the Init() to tie in HttpApplication events
            webSessionStorage = new WebSessionStorage(this);
        }
        public void Configuration(IAppBuilder app)
        {
            ISessionStorage storage = new WebSessionStorage(HttpContext.Current.ApplicationInstance);

            var allEntities = Assembly.GetAssembly(typeof(Aluno)).GetExportedTypes()
                              .Where(t =>
                                     typeof(EntityWithTypedId <string>).IsAssignableFrom(t) &&
                                     !typeof(EntityWithTypedId <string>).Equals(t) ||
                                     typeof(EntityWithTypedId <int>).IsAssignableFrom(t) &&
                                     !typeof(EntityWithTypedId <int>).Equals(t))
                              .ToList();

            var           localMapping = MappingHelper.GetIdentityMappings(allEntities);
            Configuration config       = NHibernateSessionHelper.Init(storage, null, null, null, localMapping);

            BuildSchema(config, "life_joy.sql");
        }
Beispiel #4
0
 /// <summary>
 /// Due to issues on IIS7, the NHibernate initialization must occur in Init().
 /// But Init() may be invoked more than once; accordingly, we introduce a thread-safe
 /// mechanism to ensure it's only initialized once.
 /// See http://msdn.microsoft.com/en-us/magazine/cc188793.aspx for explanation details.
 /// </summary>
 public override void Init()
 {
     base.Init();
     this.webSessionStorage = new WebSessionStorage(this);
 }
Beispiel #5
0
 /// <summary>
 ///     Due to issues on IIS7, the NHibernate initialization must occur in Init().
 ///     But Init() may be invoked more than once; accordingly, we introduce a thread-safe
 ///     mechanism to ensure it's only initialized once.
 ///     See http://msdn.microsoft.com/en-us/magazine/cc188793.aspx for explanation details.
 /// </summary>
 public override void Init()
 {
     base.Init();
     this._webSessionStorage = new WebSessionStorage(this);
     _threadSessionStorage   = new ThreadSessionStorage();
 }
Beispiel #6
0
        private static void ConfigureData()
        {
            var storage = new WebSessionStorage(System.Web.HttpContext.Current.ApplicationInstance);

            DataConfig.Configure(storage);
        }
 public static void Initialize(HttpApplication app, WebSessionStorage storage)
 {
     NHibernateInitializer.Instance().InitializeNHibernateOnce(new NHibernateInitializerConfig(app, storage).InitialiseNHibernateSessions);
 }
 public NHibernateInitializerConfig(HttpApplication app, WebSessionStorage storage)
 {
     webSessionStorage = storage;
     application       = app;
 }
Beispiel #9
0
 public override void Init()
 {
     base.Init();
     // we have to create WebSessionStorage in Init() so we can hook into HttpApplication events
     sessionStorage = new WebSessionStorage(this);
 }