Example #1
0
 private void LoadMyImages(string userId)
 {
     foreach (var myimg in ijpContext.File.Where(x => x.UserId == userId))
     {
         Images.Add(new FileModel()
         {
             FileId               = myimg.FileId,
             CategoryId           = myimg.CategoryId,
             RawFormat            = myimg.RawFormat,
             IsPrivate            = myimg.IsPrivate,
             IsLandscape          = myimg.IsLandscape,
             LengthKB             = myimg.LengthKB,
             Name                 = myimg.Name,
             Title                = myimg.Title,
             Width                = myimg.Width,
             Height               = myimg.Height,
             HorizontalResolution = myimg.HorizontalResolution,
             VerticalResolution   = myimg.VerticalResolution,
             PixelFormat          = myimg.PixelFormat,
             Url             = AzureStorage.BlobUrlAsync(userId, myimg.Name).GetAwaiter().GetResult().ToString(),
             UrlResized      = AzureStorage.BlobUrlAsync(userId, myimg.ResizedFileName).GetAwaiter().ToString(),
             UrlThumb        = AzureStorage.BlobUrlAsync(userId, myimg.ThumbFileName).GetAwaiter().GetResult().ToString(),
             ThumbFileName   = myimg.ThumbFileName,
             ResizedFileName = myimg.ResizedFileName,
             Content         = AzureStorage.DownloadFileFromBlob(myimg.Name, userId).GetAwaiter().GetResult(),
             UserId          = userId
         });
     }
 }
Example #2
0
        public async Task <string> GetUrl(string containerName, string blobName)
        {
            var url = await AzureStorage.BlobUrlAsync(containerName, blobName);

            return(url);
        }