Skip to content

Add named registration for mongodb client #2

Description

@snovak7

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.

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions