コード例 #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;
        }
コード例 #2
0
        /// <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;
        }