Summary
Having #1 we can proceed with registering a named MongoDb Client.
Expectations
As with #1 we again have 3 difference interfaces we need to cover.
Use Cases
We provide similar methods as with options, but we add some additional methods in case we want to share options
IServiceCollection
Default without defined options
public static IServiceCollection AddMongoDbClientAsDefault(this IServiceCollection, ...) {...}
Default with defined custom options.
public static IServiceCollection AddMongoDbClientAsDefaultFromOptions(this IServiceCollection, ..., string optionsName) {...}
Named without defined options
public static IServiceCollection AddMongoDbClient(this IServiceCollection, ...) {...}
Named with defined options
public static IServiceCollection AddMongoDbClientFromOptions(this IServiceCollection, string name, ..., string optionsName) {...}
IHostBuilder & WebApplicationBuilder
The above is applied in this fashion as-well.
Summary
Having #1 we can proceed with registering a named MongoDb Client.
Expectations
As with #1 we again have 3 difference interfaces we need to cover.
Use Cases
We provide similar methods as with options, but we add some additional methods in case we want to share options
IServiceCollection
Default without defined options
Default with defined custom options.
Named without defined options
Named with defined options
IHostBuilder & WebApplicationBuilder
The above is applied in this fashion as-well.