public void AddUser(User user) { lock (_accessLock) { _users.Add(user); } Task.Run(() => _databaseAdapter.AddUser(user)); }
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); }