Redis 查询、写入

string;

var user = RedisManager.Get<xxx>("user:" + token);

RedisManager.Set("module:" + token, list);

hash:

List<xxx> model = RedisManager.HashGetAll<se_variety_menu>("menu:" + type_id);

RedisManager.HashSet("menu:" + type_id, model, o => o.id, DateTime.Now.AddDays(1));

sortset:

var redis = RedisManager.SortedGetAll<RoomSortedModel>("room:" + build);

double temp;
RedisManager.SortedSetAdd("room:" + build, model, o => double.TryParse(o.floor, out temp) == true ? o.floor : "0", DateTime.Now.AddHours(1));

posted @ 2019-09-30 16:58  艺洁  阅读(1162)  评论(0编辑  收藏  举报