📌  相关文章
📜  在 .net core api 的启动文件中添加动态值 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:50.291000             🧑  作者: Mango

代码示例1
public void ConfigureServices(IServiceCollection services)
{
     Action mduOptions = (opt =>
     {
          opt.CompanyCode = "aaaa";
     });
     services.Configure(mduOptions);
     services.AddSingleton(resolver => resolver.GetRequiredService>().Value);
     services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
}