Method AddDbContextOnly
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
IServiceCollectionThe 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.