Esempio n. 1
0
        public void AddUser(User user)
        {
            lock (_accessLock)
            {
                _users.Add(user);
            }

            Task.Run(() => _databaseAdapter.AddUser(user));
        }
Esempio n. 2
0
 private SubscriptionEvent HandleSubscriptionActions(SubscribtionAct act)
 {
     if (act is CreateSubscription createSubscription)
     {
         var(subscriptionWasAdded, user) = _userService.AddUserSubscription(createSubscription.Subscription);
         if (subscriptionWasAdded)
         {
             _databaseAdapter.AddUser(user);
         }
         return(new UserSubscriptionCreated(user.ClientId));
     }
     return(null);
 }