Answers for "add dynamic value in startup file in .net core api"

C#
0

add dynamic value in startup file in .net core api

public void ConfigureServices(IServiceCollection services)
{
     Action<MDUOptions> mduOptions = (opt =>
     {
          opt.CompanyCode = "aaaa";
     });
     services.Configure(mduOptions);
     services.AddSingleton(resolver => resolver.GetRequiredService<IOptions<MDUOptions>>().Value);
     services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
}
Posted by: Guest on June-25-2021

Code answers related to "add dynamic value in startup file in .net core api"

C# Answers by Framework

Browse Popular Code Answers by Language