Table of Contents

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 IServiceCollection

Service collection to add to

config IConfiguration

App configuration

contextLifetime ServiceLifetime

Lifetime of the service to inject

logFactory ILoggerFactory

logger factory

addSteeltoeHealthChecks bool

Add 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 IServiceCollection

Service collection to add to

config IConfiguration

App configuration

serviceName string

cloud foundry service name binding

contextLifetime ServiceLifetime

Lifetime of the service to inject

logFactory ILoggerFactory

logger factory

addSteeltoeHealthChecks bool

Add Steeltoe healthChecks

Returns

IServiceCollection

IServiceCollection for chaining

Remarks

NpgsqlConnection is retrievable as both NpgsqlConnection and IDbConnection