Ejemplo n.º 1
0
 public static IConfigurationBuilder AddAppConfigFile(this IConfigurationBuilder builder, IFileProvider provider, string path, bool optional, bool reloadOnChange)
 {
     if (builder == null)
     {
         throw new ArgumentNullException(nameof(builder));
     }
     if (string.IsNullOrEmpty(path))
     {
         throw new ArgumentException("路径不能为空", nameof(path));
     }
     return(builder.AddAppConfigFile(s =>
     {
         //s.FileProvider = provider ?? builder.GetFileProvider();
         ///<see cref="AppConfigConfigurationSource.Build(IConfigurationBuilder)"/>
         s.FileProvider = provider;
         s.Path = path;
         s.Optional = optional;
         s.ReloadOnChange = reloadOnChange;
         s.ResolveFileProvider();
     }));
 }
Ejemplo n.º 2
0
 public static IConfigurationBuilder AddAppConfigFile(this IConfigurationBuilder builder, string path)
 {
     return(builder.AddAppConfigFile(null, path, false, false));
 }
Ejemplo n.º 3
0
 public static IConfigurationBuilder AddAppConfigFile(this IConfigurationBuilder builder, string path, bool optional, bool reloadOnChange)
 {
     return(builder.AddAppConfigFile(null, path, optional, reloadOnChange));
 }