コード例 #1
0
        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);
        }
コード例 #2
0
 public GatewayConfigurationProvider(GatewayConfigurationSource source) : base(source)
 {
 }