예제 #1
0
 public UserProblemAccount GetAccount(ulong userId)
 {
     return(_cAccounts.GetOrAdd(userId, (key) => {
         var newAccount = new UserProblemAccount {
             Id = userId
         };
         _storage.Store(newAccount, GroupKey, GetKeyFor(newAccount));
         return newAccount;
     }));
 }
예제 #2
0
 public void SaveAccount(UserProblemAccount account)
 {
     _storage.Store(account, GroupKey, GetKeyFor(account));
 }
예제 #3
0
 private string GetKeyFor(UserProblemAccount account)
 {
     return(string.Format(KeyFormat, account.Id));
 }