public async Task <BlobContent> ReadBlobContentAsync(long tenantId, long elementId, long blobSetId, string blobLabel) { AlbumElementSettings settings = await _elementRepository.ReadElementSettingsAsync(tenantId, elementId); if (settings == null) { return(null); } AlbumPhoto photo = settings.Photos.Where(p => p.BlobSetId == blobSetId).FirstOrDefault(); if (photo == null) { return(null); } long?blobId = GetBlobId(photo, blobLabel); if (blobId == null) { return(null); } return(await _storageService.ReadBlobContentAsync(tenantId, blobId.Value, string.Format(AlbumImagePath, elementId))); }
private long?GetBlobId(AlbumPhoto photo, string blobLabel) { switch (blobLabel) { case OriginalBlobLabel: return(photo.ImageBlobId); case PreviewBlobLabel: return(photo.PreviewImageBlobId); case ThumbnailBlobLabel: return(photo.ThumbnailImageBlobId); default: return(photo.PreviewImageBlobId); } }