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); } }
public static AzureBlobConfig GetDestinationAzureBlobConfig() { AzureBlobConfig azureBlobConfig = new AzureBlobConfig() { ConnectionString = ConfigurationManager.AppSettings["storageConnStr"] }; ValidateConfig(azureBlobConfig, "Destination"); return(azureBlobConfig); }
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); } }
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); }