Esempio n. 1
0
 public async Task<User> UpdateDataAsync(User user, bool validate = false)
 {
     if (!Users.ContainsKey(user.Id))
     {
         await user.ForceValidate();
         Users[user.Id] = user;
     }
     else
     {
         if (validate)
         {
             await user.ForceValidate();
         }
         user.CopyTo(Users[user.Id]);
     }
     return Users[user.Id];
 }
Esempio n. 2
0
 public User GetUser(string id)
 {
     if (!Users.ContainsKey(id))
     {
         var user = new User(id);
         user.ForceValidate();
         Users[id] = user;
     }
     else
     {
         Users[id].ForceValidate();
     }
     return Users[id];
 }
Esempio n. 3
0
 public async Task<User> GetUserAsync(string id)
 {
     if (!Users.ContainsKey(id))
     {
         var user = new User(id);
         await user.ForceValidate();
         Users[id] = user;
     }
     else
     {
         await Users[id].Validate();
     }
     return Users[id];
 }