/// <summary> /// Adds the gateway file. /// </summary> /// <param name="builder">The builder.</param> /// <param name="provider">The provider.</param> /// <param name="path">The path.</param> /// <param name="optional">if set to <c>true</c> [optional].</param> /// <param name="reloadOnChange">if set to <c>true</c> [reload on change].</param> /// <returns>IConfigurationBuilder.</returns> public static IConfigurationBuilder AddGatewayFile(this IConfigurationBuilder builder, IFileProvider provider, string path, bool optional, bool reloadOnChange) { Check.NotNull(builder, "builder"); Check.CheckCondition(() => string.IsNullOrEmpty(path), "path"); if (provider == null && Path.IsPathRooted(path)) { provider = new PhysicalFileProvider(Path.GetDirectoryName(path)); path = Path.GetFileName(path); } var source = new GatewayConfigurationSource { FileProvider = provider, Path = path, Optional = optional, ReloadOnChange = reloadOnChange }; builder.Add(source); AppConfig.Configuration = builder.Build(); return(builder); }
/// <summary> /// Initializes a new instance of the <see cref="GatewayConfigurationProvider" /> class. /// </summary> /// <param name="source">The source.</param> public GatewayConfigurationProvider(GatewayConfigurationSource source) : base(source) { }