예제 #1
0
        /// <summary>
        /// Overrides the ISession instance on <see cref="RailsEngineContextAdapter"/>.
        /// </summary>
        /// <remarks>Note that the session available through IHttpContext is left untouched</remarks>
        /// <param name="context"></param>
        public override void OnRailsContextCreated(IRailsEngineContext context, IServiceProvider serviceProvider)
        {
            IDictionary session = customSession.ObtainSession(context);

            (context as RailsEngineContextAdapter).Session = session;
        }
        /// <summary>
        /// Overrides the ISession instance on <see cref="IEngineContext"/>.
        /// </summary>
        /// <remarks>
        /// Note that the session available through IHttpContext is left untouched</remarks>
        /// <param name="context"></param>
        private void OnAdquireSessionState(IEngineContext context)
        {
            var session = customSession.ObtainSession(context);

            context.Session = session;
        }