Table of Contents

Method AddDbContextOnly

Namespace
Innova.Data.Entity
Assembly
Innova.Data.dll

AddDbContextOnly<TContext>(IServiceCollection, Action<DbContextOptionsBuilder>)

Adds the specified TContext to the IServiceCollection as a scoped service.

public static DbContextOptionsBuilder AddDbContextOnly<TContext>(this IServiceCollection services, Action<DbContextOptionsBuilder> optionsAction = null) where TContext : DbContext

Parameters

services IServiceCollection

The IServiceCollection to add the TContext to.

optionsAction Action<DbContextOptionsBuilder>

An optional action to configure the DbContextOptionsBuilder.

Returns

DbContextOptionsBuilder

The DbContextOptionsBuilder for further configuration.

Type Parameters

TContext

The type of the DbContext.