private void UpdateCache(Account account) { var department = Core.DepartmentManager.GetModel(account.DepartmentId); var rank = Core.RankManager.GetModel(account.RankId); var vAccount = new VAccount { AccountId = account.AccountId, CreateTime = account.CreateTime, Username = account.Username, Deleted = account.Deleted, Department = department == null ? null : department.Name, Rank = rank == null ? null : rank.Name, TrueName = account.TrueName, Status = account.Status }; UpdateCache(vAccount); }
public void UpdateCache(VAccount account) { Cache.HSet("account_id", account.AccountId.ToString(), account); Cache.HSet("account_display_name", account.Department + "_" + account.Rank + "_" + account.TrueName, account); Cache.HSet("account_name", account.TrueName, account); }