Class SqlServerDbContextServiceCollectionExtensions
- Namespace
- Steeltoe.CloudFoundry.Connector.SqlServer.EF6
- Assembly
- Steeltoe.CloudFoundry.Connector.EF6Core.dll
public static class SqlServerDbContextServiceCollectionExtensions
- Inheritance
-
SqlServerDbContextServiceCollectionExtensions
- Inherited Members
Methods
AddDbContext<TContext>(IServiceCollection, IConfiguration, ServiceLifetime, ILoggerFactory)
Add a Microsoft SQL Server-backed DbContext and SQL Server health contributor to the Service Collection
public static IServiceCollection AddDbContext<TContext>(this IServiceCollection services, IConfiguration config, ServiceLifetime contextLifetime = ServiceLifetime.Scoped, ILoggerFactory logFactory = null)
Parameters
services
IServiceCollectionService Collection
config
IConfigurationApplication Configuration
contextLifetime
ServiceLifetimeLifetime of the service to inject
logFactory
ILoggerFactoryLogging factory
Returns
- IServiceCollection
IServiceCollection for chaining
Type Parameters
TContext
Type of DbContext to add
AddDbContext<TContext>(IServiceCollection, IConfiguration, string, ServiceLifetime, ILoggerFactory)
Add a Microsoft SQL Server-backed DbContext to the Service Collection
public static IServiceCollection AddDbContext<TContext>(this IServiceCollection services, IConfiguration config, string serviceName, ServiceLifetime contextLifetime = ServiceLifetime.Scoped, ILoggerFactory logFactory = null)
Parameters
services
IServiceCollectionService Collection
config
IConfigurationApplication Configuration
serviceName
stringName of service binding in Cloud Foundry
contextLifetime
ServiceLifetimeLifetime of the service to inject
logFactory
ILoggerFactoryLogging factory
Returns
- IServiceCollection
IServiceCollection for chaining
Type Parameters
TContext
Type of DbContext to add