Example #1
0
        public async Task <IEnumerable <Photo> > GetPhotos(Guid profileId, CancellationToken cancellationToken)
        {
            var photoReferences = await _store.GetPhotos(profileId, cancellationToken).ConfigureAwait(false);

            var tasks = photoReferences.Select(x => _store.GetPhoto(profileId, x, cancellationToken));

            var photos = await Task.WhenAll(tasks).ConfigureAwait(false);

            return(photos);
        }
Example #2
0
        public async Task DeletePhotos(Guid profileId, CancellationToken cancellationToken)
        {
            Ensure.Guid.IsNotEmpty(profileId, nameof(profileId));

            var photoReferences = await _store.GetPhotos(profileId, cancellationToken).ConfigureAwait(false);

            var tasks = photoReferences.Select(x => _store.DeletePhoto(profileId, x, cancellationToken));

            await Task.WhenAll(tasks).ConfigureAwait(false);
        }