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); }
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); }