public static ITypedConfigurationBuilder AddJsonFile <T>(this ITypedConfigurationBuilder builder, string path, bool optional, bool reloadOnChange) { if (builder == null) { throw new ArgumentNullException("builder"); } if (string.IsNullOrEmpty(path)) { throw new ArgumentNullException(nameof(path)); } JsonTypedConfigurationSource jsonConfigurationSource = new JsonTypedConfigurationSource(typeof(T)) { FileProvider = null,// provider, Path = path, Optional = optional, ReloadOnChange = reloadOnChange }; jsonConfigurationSource.ResolveFileProvider(); builder.Add(jsonConfigurationSource); return(builder); }
/// <summary> /// Initializes a new instance with the specified source. /// </summary> /// <param name="source">The source settings.</param> public JsonTypedConfigurationProvider(JsonTypedConfigurationSource source) : base(source) { }