用于生成 Office 文件的 .NET 组件。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
769 B

using Microsoft.Extensions.Configuration;
using System.Collections.Specialized;
using System.Linq;
namespace System.Configuration
{
// TODO: Replace this shim with actual Options class
public static class ConfigurationManager
{
public static NameValueCollection AppSettings { get; }
static ConfigurationManager()
{
AppSettings = new ConfigurationBuilder()
.AddJsonFile("appsettings.json", false)
.Build()
.GetSection("AppSettings")
.GetChildren()
.Aggregate(new NameValueCollection(), (acc, cur) =>
{
acc.Add(cur.Key, cur.Value);
return acc;
});
}
}
}