You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need options mechanism for registering MongoDb Client. Extensions methods are used here to have a good DX (developer experience)
Expectations
We have 3 different interfaces where we want to do register options for MongoDb Client
IServiceCollection - Console Apps, Manual Service Collection initialization IHostBuilder - Orleans Server without Kestrel, ASP.NET Core Workers WebApplicationBuilder/IApplicationBuilder - Orleans Server with Kestrel, ASP.NET Core Web Apps
Summary
We need options mechanism for registering MongoDb Client. Extensions methods are used here to have a good DX (developer experience)
Expectations
We have 3 different interfaces where we want to do register options for MongoDb Client
IServiceCollection- Console Apps, Manual Service Collection initializationIHostBuilder- Orleans Server without Kestrel, ASP.NET Core WorkersWebApplicationBuilder/IApplicationBuilder- Orleans Server with Kestrel, ASP.NET Core Web AppsThis concept applies for all registration. Eventually need to dump this in a knowledge base!
Use cases
IServiceCollection
This interface registers only lowest level
Default
Named
IHostBuilder
Default
Named
Because
IHostBuilderhas Configuration we can also apply 2 more overloads for eachWith Options Builder
Bind directly to App Settings
WebApplicationBuilder
This one mostly applies all extensions method from
IHostBuilderdirectly to.HostProperty (Proxy)