Example #1
0
 private static void ValidateConfig(AzureBlobConfig config, string azureBlobType)
 {
     if (string.IsNullOrEmpty(config.ConnectionString))
     {
         Logger.LogError(string.Format("Missing value in app.config for {0} Azure Blob Store.",
                                       azureBlobType), true);
     }
 }
Example #2
0
        public static AzureBlobConfig GetDestinationAzureBlobConfig()
        {
            AzureBlobConfig azureBlobConfig = new AzureBlobConfig()
            {
                ConnectionString = ConfigurationManager.AppSettings["storageConnStr"]
            };

            ValidateConfig(azureBlobConfig, "Destination");
            return(azureBlobConfig);
        }
Example #3
0
        private static void ValidateConfig(ILogger logger, AzureBlobConfig config, string azureBlobType)
        {
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }

            if (string.IsNullOrEmpty(config.ConnectionString))
            {
                string message = $"Missing value in app.config for '{azureBlobType}' Azure Blob Store.";
                logger.LogError(message);

                throw new NotSupportedException(message);
            }
        }
Example #4
0
        public static AzureBlobConfig GetDestinationAzureBlobConfig(ILogger logger)
        {
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }

            AzureBlobConfig azureBlobConfig = new AzureBlobConfig()
            {
                ConnectionString = ConfigurationManager.AppSettings["storageConnStr"]
            };

            ValidateConfig(logger, azureBlobConfig, "Destination");
            return(azureBlobConfig);
        }