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
servicesIServiceCollectionThe IServiceCollection to add the
TContextto.optionsActionAction<DbContextOptionsBuilder>An optional action to configure the DbContextOptionsBuilder.
Returns
- DbContextOptionsBuilder
The DbContextOptionsBuilder for further configuration.
Type Parameters
TContextThe type of the DbContext.