Class MySqlProviderServiceCollectionExtensions
- Namespace
- Steeltoe.CloudFoundry.Connector.MySql
- Assembly
- Steeltoe.CloudFoundry.ConnectorCore.dll
public static class MySqlProviderServiceCollectionExtensions
- Inheritance
-
MySqlProviderServiceCollectionExtensions
- Inherited Members
Methods
AddMySqlConnection(IServiceCollection, IConfiguration, ServiceLifetime, ILoggerFactory, bool)
Add MySql and its IHealthContributor to a ServiceCollection
public static IServiceCollection AddMySqlConnection(this IServiceCollection services, IConfiguration config, ServiceLifetime contextLifetime = ServiceLifetime.Scoped, ILoggerFactory logFactory = null, bool addSteeltoeHealthChecks = false)
Parameters
servicesIServiceCollectionService collection to add to
configIConfigurationApp configuration
contextLifetimeServiceLifetimeLifetime of the service to inject
logFactoryILoggerFactorylogging factory
addSteeltoeHealthChecksboolAdd steeltoeHealth checks even if community health checks exist
Returns
- IServiceCollection
IServiceCollection for chaining
Remarks
MySqlConnection is retrievable as both MySqlConnection and IDbConnection
AddMySqlConnection(IServiceCollection, IConfiguration, string, ServiceLifetime, ILoggerFactory, bool)
Add MySql and its IHealthContributor to a ServiceCollection.
public static IServiceCollection AddMySqlConnection(this IServiceCollection services, IConfiguration config, string serviceName, ServiceLifetime contextLifetime = ServiceLifetime.Scoped, ILoggerFactory logFactory = null, bool addSteeltoeHealthChecks = false)
Parameters
servicesIServiceCollectionService collection to add to
configIConfigurationApp configuration
serviceNamestringcloud foundry service name binding
contextLifetimeServiceLifetimeLifetime of the service to inject
logFactoryILoggerFactorylogging factory
addSteeltoeHealthChecksboolAdd steeltoeHealth checks even if community health checks exist
Returns
- IServiceCollection
IServiceCollection for chaining
Remarks
MySqlConnection is retrievable as both MySqlConnection and IDbConnection