Class PostgresProviderServiceCollectionExtensions
- Namespace
- Steeltoe.CloudFoundry.Connector.PostgreSql
- Assembly
- Steeltoe.CloudFoundry.ConnectorCore.dll
public static class PostgresProviderServiceCollectionExtensions
- Inheritance
-
PostgresProviderServiceCollectionExtensions
- Inherited Members
Methods
AddPostgresConnection(IServiceCollection, IConfiguration, ServiceLifetime, ILoggerFactory, bool)
Add NpgsqlConnection and its IHealthContributor to a ServiceCollection
public static IServiceCollection AddPostgresConnection(this IServiceCollection services, IConfiguration config, ServiceLifetime contextLifetime = ServiceLifetime.Scoped, ILoggerFactory logFactory = null, bool addSteeltoeHealthChecks = false)
Parameters
services
IServiceCollectionService collection to add to
config
IConfigurationApp configuration
contextLifetime
ServiceLifetimeLifetime of the service to inject
logFactory
ILoggerFactorylogger factory
addSteeltoeHealthChecks
boolAdd Steeltoe healthChecks
Returns
- IServiceCollection
IServiceCollection for chaining
Remarks
NpgsqlConnection is retrievable as both NpgsqlConnection and IDbConnection
AddPostgresConnection(IServiceCollection, IConfiguration, string, ServiceLifetime, ILoggerFactory, bool)
Add NpgsqlConnection and its IHealthContributor to a ServiceCollection
public static IServiceCollection AddPostgresConnection(this IServiceCollection services, IConfiguration config, string serviceName, ServiceLifetime contextLifetime = ServiceLifetime.Scoped, ILoggerFactory logFactory = null, 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
logFactory
ILoggerFactorylogger factory
addSteeltoeHealthChecks
boolAdd Steeltoe healthChecks
Returns
- IServiceCollection
IServiceCollection for chaining
Remarks
NpgsqlConnection is retrievable as both NpgsqlConnection and IDbConnection