Class MongoDbProviderServiceCollectionExtensions
- Namespace
- Steeltoe.CloudFoundry.Connector.MongoDb
- Assembly
- Steeltoe.CloudFoundry.ConnectorCore.dll
public static class MongoDbProviderServiceCollectionExtensions
- Inheritance
-
MongoDbProviderServiceCollectionExtensions
- Inherited Members
Methods
AddMongoClient(IServiceCollection, IConfiguration, ServiceLifetime, bool)
Add MongoDb to a ServiceCollection
public static IServiceCollection AddMongoClient(this IServiceCollection services, IConfiguration config, ServiceLifetime contextLifetime = ServiceLifetime.Singleton, bool addSteeltoeHealthChecks = false)
Parameters
services
IServiceCollectionService collection to add to
config
IConfigurationApp configuration
contextLifetime
ServiceLifetimeLifetime of the service to inject
addSteeltoeHealthChecks
boolAdd Steeltoe healthChecks
Returns
- IServiceCollection
IServiceCollection for chaining
AddMongoClient(IServiceCollection, IConfiguration, string, ServiceLifetime, bool)
Add MongoDb to a ServiceCollection
public static IServiceCollection AddMongoClient(this IServiceCollection services, IConfiguration config, string serviceName, ServiceLifetime contextLifetime = ServiceLifetime.Singleton, bool addSteeltoeHealthChecks = false)
Parameters
services
IServiceCollectionService collection to add to
config
IConfigurationApp configuration
serviceName
stringcloud foundry service name binding
contextLifetime
ServiceLifetimeLifetime of the service to inject
addSteeltoeHealthChecks
boolAdd Steeltoe healthChecks
Returns
- IServiceCollection
IServiceCollection for chaining