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