Table of Contents

Class DbContextSectionStoreServiceCollectionExtensions

Namespace
Arc4u.Configuration.Store
Assembly
Arc4u.Configuration.Store.EFCore.dll

Extension methods to register the Entity Framework Core implementation of the section store.

public static class DbContextSectionStoreServiceCollectionExtensions
Inheritance
DbContextSectionStoreServiceCollectionExtensions
Inherited Members

Methods

AddDbContextSectionStore<TDbContext>(IServiceCollection)

Registers, as a scoped service (if not already registered), an ISectionStore that persists the sections in the specified DbContext. The context must expose a SectionEntity entity (see Configure(EntityTypeBuilder<SectionEntity>)).

public static IServiceCollection AddDbContextSectionStore<TDbContext>(this IServiceCollection services) where TDbContext : DbContext

Parameters

services IServiceCollection

The service collection.

Returns

IServiceCollection

The service collection, to chain calls.

Type Parameters

TDbContext

The type of the DbContext holding the SectionEntity table.

Examples

services.AddDbContext<MyDbContext>(options => options.UseSqlServer(connectionString));
services.AddDbContextSectionStore<MyDbContext>();
services.AddSectionStoreService();