示例#1
0
        public async Task <IActionResult> GetThumbNails()
        {
            try
            {
                /*
                 * if (storageConfig.AccountKey == string.Empty || storageConfig.AccountName == string.Empty)
                 *
                 *  return BadRequest("sorry, can't retrieve your azure storage details from appsettings.js, make sure that you add azure storage details there");
                 *
                 * if (storageConfig.ImageContainer == string.Empty)
                 *
                 *  return BadRequest("Please provide a name for your image container in the azure blob storage");
                 */
                storageConfig.AccountName    = "jasseraccount";
                storageConfig.AccountKey     = "SMaAsGPvFmPO+tDDX5+JtqqRBplNzvgJS6tUj9NllEi5TUSRZb0y3HY7eedq9ac/+zwe/vW+onc68K0ugpF+jA==";
                storageConfig.ImageContainer = "images";

                List <string> thumbnailUrls = await StorageHelper.GetThumbNailUrls(storageConfig);

                return(new ObjectResult(thumbnailUrls));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
示例#2
0
        private async Task <string> GetTGetLastImagehumbNail()
        {
            try
            {
                if (storageConfig.AccountKey == string.Empty || storageConfig.AccountName == string.Empty)
                {
                    return("Nu ai account key");
                }



                if (storageConfig.ImageContainer == string.Empty)
                {
                    return("Nu ai image container");
                }

                List <string> thumbnailUrls = await StorageHelper.GetThumbNailUrls(storageConfig);

                return(thumbnailUrls.LastOrDefault());
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message).ToString());
            }
        }
        public async Task <IActionResult> GetThumbNails()
        {
            try {
                if (string.IsNullOrEmpty(StorageConfig.AccountKey) || string.IsNullOrEmpty(StorageConfig.AccountName))
                {
                    return(BadRequest("Sorry, can't retrieve your Azure storage details from appsettings.js, make sure that you add Azure storage details there."));
                }

                if (string.IsNullOrEmpty(StorageConfig.ImageContainer))
                {
                    return(BadRequest("Please provide a name for your image container in Azure blob storage."));
                }
                List <string> thumbnailUrls = await StorageHelper.GetThumbNailUrls(StorageConfig);

                return(new ObjectResult(thumbnailUrls));
            } catch (Exception ex) {
                return(BadRequest(ex.Message));
            }
        }
        public async Task <IActionResult> GetThumbNails()
        {
            try
            {
                if (storageConfig.AccountKey == string.Empty || storageConfig.AccountName == string.Empty)
                {
                    return(BadRequest("Could not find Azure Storage AccountKey and AccountName."));
                }

                if (storageConfig.ImageContainer == string.Empty)
                {
                    return(BadRequest("Could not find Azure Blob Storage Image Container Name."));
                }

                List <string> thumbnailUrls = await StorageHelper.GetThumbNailUrls(storageConfig);

                return(new ObjectResult(thumbnailUrls));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }