Esempio n. 1
0
        /// <summary>
        /// Gets the session.
        /// </summary>
        /// <returns>SessionInfo.</returns>
        protected SessionInfo GetSession(ISessionContext sessionContext)
        {
            var session = sessionContext.GetSession(Request);

            if (session == null)
            {
                throw new ArgumentException("Session not found.");
            }

            return(session);
        }
Esempio n. 2
0
        /// <summary>
        /// Gets the session.
        /// </summary>
        /// <returns>SessionInfo.</returns>
        protected async Task <SessionInfo> GetSession(ISessionContext sessionContext)
        {
            var session = await sessionContext.GetSession(Request).ConfigureAwait(false);

            if (session == null)
            {
                throw new ArgumentException("Session not found.");
            }

            return(session);
        }