【发布时间】:2018-05-24 12:02:03
【问题描述】:
如何使用构造函数参数,其值存储在appsettings.json中?
services.AddTransient<IService, Service>(x => new Service("arg1", "arg2"));
我使用IOptions 接口读取我的配置值
services.Configure<MyOptions>(Configuration.GetSection(nameof(MyOptions)));
【问题讨论】:
标签: c# asp.net-core asp.net-core-2.0