예제 #1
0
        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)));
        }
예제 #2
0
        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);
            }
        }