public static ITypedConfigurationBuilder AddXmlFile <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));
            }
            XmlTypedConfigurationSource jsonConfigurationSource = new XmlTypedConfigurationSource(typeof(T))
            {
                FileProvider   = null,// provider,
                Path           = path,
                Optional       = optional,
                ReloadOnChange = reloadOnChange
            };

            jsonConfigurationSource.ResolveFileProvider();
            builder.Add(jsonConfigurationSource);
            return(builder);
        }
Example #2
0
 /// <summary>
 /// Initializes a new instance with the specified source.
 /// </summary>
 /// <param name="source">The source settings.</param>
 public XmlTypedConfigurationProvider(XmlTypedConfigurationSource source) : base(source)
 {
 }