Class PostgresProviderServiceCollectionExtensions
- Namespace
- Steeltoe.Connector.PostgreSql
- Assembly
- Steeltoe.Connector.ConnectorCore.dll
public static class PostgresProviderServiceCollectionExtensions
- Inheritance
-
PostgresProviderServiceCollectionExtensions
- Inherited Members
Methods
AddPostgresConnection(IServiceCollection, IConfiguration, ServiceLifetime, bool)
Add NpgsqlConnection and its IHealthContributor to a ServiceCollection
public static IServiceCollection AddPostgresConnection(this IServiceCollection services, IConfiguration config, ServiceLifetime contextLifetime = ServiceLifetime.Scoped, 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
Remarks
NpgsqlConnection is retrievable as both NpgsqlConnection and IDbConnection
AddPostgresConnection(IServiceCollection, IConfiguration, string, ServiceLifetime, bool)
Add NpgsqlConnection and its IHealthContributor to a ServiceCollection
public static IServiceCollection AddPostgresConnection(this IServiceCollection services, IConfiguration config, string serviceName, ServiceLifetime contextLifetime = ServiceLifetime.Scoped, 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
Remarks
NpgsqlConnection is retrievable as both NpgsqlConnection and IDbConnection