Beispiel #1
0
        //public ISessionFactory SessionFactory { get; set; }

        //private ISession session;
        //public ISession Session
        //{
        //    get
        //    {
        //        return session ?? (session =
        //            SessionFactory.GetOrCreateSession(
        //                new HttpRequestWrapper(null, HttpContext.Current.Request),
        //                new HttpResponseWrapper(HttpContext.Current.Response)
        //            ));
        //    }
        //}

        protected override object Run(Session request)
        {
            var untyped = Session["untyped"] as CustomSession ?? new CustomSession();
            var typed   = Session.Get <CustomSession>("typed") ?? new CustomSession();

            untyped.Counter++;
            typed.Counter++;

            Session["untyped"] = untyped;
            Session.Set("typed", typed);

            var response = new SessionResponse {
                Typed   = typed,
                UnTyped = untyped,
            };

            return(response);
        }
        public object Any(Session request)
		{
			var untyped = Session["untyped"] as CustomSession ?? new CustomSession();			
			var typed = Session.Get<CustomSession>("typed") ?? new CustomSession();

			untyped.Counter++;
			typed.Counter++;

			Session["untyped"] = untyped;
			Session.Set("typed", typed);

			var response = new SessionResponse {
				Typed = typed,
				UnTyped = untyped,
			};

			return response;
		}