private async Task UpdateProfile(Profile profile, CancellationToken cancellationToken)
        {
            var storeTask   = _profileStore.StoreProfile(profile, cancellationToken);
            var triggerTask = _eventTrigger.ProfileUpdated(profile, cancellationToken);

            await Task.WhenAll(storeTask, triggerTask).ConfigureAwait(false);

            _profileCache.StoreProfile(profile);
        }
예제 #2
0
        private async Task <Profile> CreateProfile(Guid profileId, User user, CancellationToken cancellationToken)
        {
            var profile = new Profile
            {
                Id        = profileId,
                Email     = user.Email,
                FirstName = user.FirstName,
                LastName  = user.LastName
            };

            await _profileStore.StoreProfile(profile, cancellationToken).ConfigureAwait(false);

            return(profile);
        }