zhaolei
8 days ago 4a2e5b9a21940f11757be37d99f0944e240e908b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#if !NET45
using Prow.Configuration;
 
namespace Microsoft.Extensions.DependencyInjection
{
    /// <summary>
    /// 配置服务注入方法扩展类
    /// </summary>
    public static class ConfigurationServiceCollectionExtensions
    {
        /// <summary>
        /// 增加配置管理到服务容器中 <see cref="IServiceCollection" />.
        /// </summary>
        /// <param name="services">The <see cref="IServiceCollection" /> to add services to.</param>
        /// <returns>The <see cref="IServiceCollection"/> so that additional calls can be chained.</returns>
        public static IServiceCollection AddConfigurationManager(this IServiceCollection services)
        {
            // 创建服务
            services.AddOptions();
            services.RegisterConfigurationManager();
            return services;
        }
    }
}
#endif