public bool CheckTokenAuthentication(int userId, string tokenKey) { string CacheName = ProjectConst.TokenCacheName + userId; var TokenAuthentication = _redisManager.GetSingleByName <TokenAuthenticationEntity>(CacheName); if (TokenAuthentication.IsNullOrEmpty()) { return(false); } if (TokenAuthentication.TokenKey != tokenKey) { return(false); } if (TokenAuthentication.ExpireDate < DateTimeHelper.Now) { return(false); } return(true); }