I am new to ASP.NET core and need some direction. I am trying to figure out a simple scenario using the application settings in ASP.NET Core, as well as using Simple Injector.
First I set Strongly-Type configuration options as described here by Rick Stral. This works great.
public class MySettings
{
public string ApplicationName { get; set; }
}
appsetting.json
{
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Debug",
"System": "Information",
"Microsoft": "Information"
}
},
"MySettings": {
"ApplicationName": "Test Service"
}
}
Startup.cs
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.AddOptions();
services.Configure<MySettings>(Configuration.GetSection("MySettings"));
services.AddSingleton(GetTestBroker(container));
}
Our other projects used Simple Injector for DI. After adding the Simple Injector package and configuring it according to the instructions, I see that my IOptions configuration is interrupted.
What I would like to know is what would be best implemented to implement the configuration in ASP.NET Core and together with other DI libraries like Simple Injector?