Class MySqlDbContextServiceCollectionExtensions
- Namespace
- Steeltoe.CloudFoundry.Connector.MySql.EF6
- Assembly
- Steeltoe.CloudFoundry.Connector.EF6Core.dll
public static class MySqlDbContextServiceCollectionExtensions
- Inheritance
-
MySqlDbContextServiceCollectionExtensions
- Inherited Members
Methods
AddDbContext<TContext>(IServiceCollection, IConfiguration, ServiceLifetime, ILoggerFactory)
Add a MySql-backed DbContext and MySQL health contributor to the Service Collection
public static IServiceCollection AddDbContext<TContext>(this IServiceCollection services, IConfiguration config, ServiceLifetime contextLifetime = ServiceLifetime.Scoped, ILoggerFactory logFactory = null)
Parameters
servicesIServiceCollectionService Collection
configIConfigurationApplication Configuration
contextLifetimeServiceLifetimeLifetime of the service to inject
logFactoryILoggerFactorylogging factory
Returns
- IServiceCollection
IServiceCollection for chaining
Type Parameters
TContextType of DbContext to add
AddDbContext<TContext>(IServiceCollection, IConfiguration, string, ServiceLifetime, ILoggerFactory)
Add a MySql-backed DbContext and MySQL health contributor to the Service Collection
public static IServiceCollection AddDbContext<TContext>(this IServiceCollection services, IConfiguration config, string serviceName, ServiceLifetime contextLifetime = ServiceLifetime.Scoped, ILoggerFactory logFactory = null)
Parameters
servicesIServiceCollectionService Collection
configIConfigurationApplication Configuration
serviceNamestringName of service binding in Cloud Foundry
contextLifetimeServiceLifetimeLifetime of the service to inject
logFactoryILoggerFactorylogging factory
Returns
- IServiceCollection
IServiceCollection for chaining
Type Parameters
TContextType of DbContext to add