コード例 #1
0
        public NHibernateSessionAttribute()
        {
            if (HttpContext.Current == null || HttpContext.Current.Session == null) return;

            var cache = new HttpSessionCache(new HttpSessionStateWrapper(HttpContext.Current.Session));
            ObjectFactory.Configure(x => x.For<ISessionCache>().Use(cache));
        }
コード例 #2
0
 public void Init()
 {
     _context = Isolate.Fake.Instance<HttpSessionStateBase>();
     _cache = new HttpSessionCache(_context);
 }