コード例 #1
0
        public List <HouseDashboard> LoadDashboard()
        {
            var dashboards = redisService.ReadCache <List <HouseDashboard> >(RedisKey.HouseDashboard.Key,
                                                                             RedisKey.HouseDashboard.DBName);

            if (dashboards == null)
            {
                dashboards = houseDapper.GetHouseDashboard();
                redisService.WriteObject(RedisKey.HouseDashboard.Key,
                                         dashboards, RedisKey.HouseDashboard.DBName);
            }
            return(dashboards);
        }
コード例 #2
0
ファイル: UserService.cs プロジェクト: elainte/58HouseSearch
 public void WriteUserToken(UserInfo loginUser, string token)
 {
     _redisService.WriteObject("user_token_" + loginUser.ID, token, 0, 60 * 24 * 30);
     _redisService.WriteObject("user_" + loginUser.ID, loginUser, 0, 60 * 24 * 30);
     _redisService.WriteObject(token, loginUser, 0, 60 * 24 * 30);
 }