コード例 #1
0
        public static AppUserModel GetSessionUser(this ISession session)
        {
            AppUserModel userModel = new AppUserModel();

            userModel = SessionExtension.Get <AppUserModel>(session, "Login");
            return(userModel);
        }
コード例 #2
0
        public static string GetSessionUserTokeyKey(this ISession session)
        {
            string token = string.Empty;

            token = SessionExtension.Get <string>(session, "FreeToken");
            return(token);
        }
コード例 #3
0
        public void OnActionExecuting(ActionExecutingContext context)
        {
            AppUserModel userModel = new AppUserModel();

            userModel = SessionExtension.Get <AppUserModel>(context.HttpContext.Session, "Login");

            if (userModel == null)
            {
                context.Result = new ViewResult
                {
                    ViewName = "Index",
                };
            }
        }