Exemplo n.º 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);
     }
 }
Exemplo n.º 2
0
        public static AzureBlobConfig GetDestinationAzureBlobConfig()
        {
            AzureBlobConfig azureBlobConfig = new AzureBlobConfig()
            {
                ConnectionString = ConfigurationManager.AppSettings["storageConnStr"]
            };

            ValidateConfig(azureBlobConfig, "Destination");
            return(azureBlobConfig);
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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);
        }