Remove IncludedConfigurationProvider since it's been added to Configuration repo

This commit is contained in:
John Luo 2016-01-07 15:19:41 -08:00
parent 294e16732f
commit 2c7f0ff35d
1 changed files with 0 additions and 39 deletions

View File

@ -1,39 +0,0 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using Microsoft.Extensions.Configuration;
namespace Microsoft.AspNet.Hosting.Internal
{
// TODO: Remove this once https://github.com/aspnet/Configuration/pull/349 gets merged
internal class IncludedConfigurationProvider : ConfigurationProvider
{
public IncludedConfigurationProvider(IConfiguration source)
{
if (source == null)
{
throw new ArgumentNullException(nameof(source));
}
int pathStart = 0;
var section = source as IConfigurationSection;
if (section != null)
{
pathStart = section.Path.Length + 1;
}
foreach (var child in source.GetChildren())
{
AddSection(child, pathStart);
}
}
private void AddSection(IConfigurationSection section, int pathStart)
{
Data.Add(section.Path.Substring(pathStart), section.Value);
foreach (var child in section.GetChildren())
{
AddSection(child, pathStart);
}
}
}
}