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
servicesIServiceCollectionService collection to add to
configIConfigurationApp configuration
contextLifetimeServiceLifetimeLifetime of the service to inject
addSteeltoeHealthChecksboolAdd 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
servicesIServiceCollectionService collection to add to
configIConfigurationApp configuration
serviceNamestringcloud foundry service name binding
contextLifetimeServiceLifetimeLifetime of the service to inject
addSteeltoeHealthChecksboolAdd Steeltoe healthChecks
Returns
- IServiceCollection
IServiceCollection for chaining
Remarks
NpgsqlConnection is retrievable as both NpgsqlConnection and IDbConnection