Esempio n. 1
0
        public async Task DeleteAccount(string username, Guid profileId, CancellationToken cancellationToken)
        {
            Ensure.String.IsNotNullOrWhiteSpace(username, nameof(username));
            Ensure.Guid.IsNotEmpty(profileId, nameof(profileId));

            await _photoCommand.DeletePhotos(profileId, cancellationToken).ConfigureAwait(false);

            await _profileCommand.DeleteProfile(profileId, cancellationToken).ConfigureAwait(false);

            var account = new Account(username);

            await _accountStore.DeleteAccount(account.Provider, account.Subject, cancellationToken).ConfigureAwait(false);

            await _userStore.DeleteUser(username, cancellationToken).ConfigureAwait(false);

            _cache.RemoveAccount(username);
        }