Table of Contents

Class MySqlDbContextServiceCollectionExtensions

Namespace
Steeltoe.Connector.MySql.EF6
Assembly
Steeltoe.Connector.EF6Core.dll
public static class MySqlDbContextServiceCollectionExtensions
Inheritance
MySqlDbContextServiceCollectionExtensions
Inherited Members

Methods

AddDbContext<TContext>(IServiceCollection, IConfiguration, ServiceLifetime)

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)

Parameters

services IServiceCollection

Service Collection

config IConfiguration

Application Configuration

contextLifetime ServiceLifetime

Lifetime of the service to inject

Returns

IServiceCollection

IServiceCollection for chaining

Type Parameters

TContext

Type of DbContext to add

AddDbContext<TContext>(IServiceCollection, IConfiguration, string, ServiceLifetime)

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)

Parameters

services IServiceCollection

Service Collection

config IConfiguration

Application Configuration

serviceName string

Name of service binding in Cloud Foundry

contextLifetime ServiceLifetime

Lifetime of the service to inject

Returns

IServiceCollection

IServiceCollection for chaining

Type Parameters

TContext

Type of DbContext to add