예제 #1
0
        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);
        }
예제 #2
0
 /// <summary>
 /// Initializes a new instance with the specified source.
 /// </summary>
 /// <param name="source">The source settings.</param>
 public JsonTypedConfigurationProvider(JsonTypedConfigurationSource source) : base(source)
 {
 }