示例#1
0
    public static IConfigurationBuilder AddLegacyWebConfigFile(this IConfigurationBuilder builder, IFileProvider provider, string path, bool optional, bool reloadOnChange)
    {
        if (provider == null && Path.IsPathRooted(path))
        {
            provider = new PhysicalFileProvider(Path.GetDirectoryName(path));
            path     = Path.GetFileName(path);
        }
        var source = new LegacyWebConfigConfigurationSource
        {
            FileProvider   = provider,
            Path           = path,
            Optional       = optional,
            ReloadOnChange = reloadOnChange
        };

        builder.Add(source);
        return(builder);
    }
 public LegacyWebConfigConfigurationProvider(LegacyWebConfigConfigurationSource source) : base(source)
 {
 }