private static string SourceDisplayName(IConfigurationSource source) { if (source is JsonConfigurationSource jsonSource) { return($"json file: {jsonSource.Path}"); } if (source is CommandLineConfigurationSource) { return("command line parameters"); } if (source is EnvironmentVariablesConfigurationSource) { return("environment variables"); } return(source.ToString()); }