Skip to main content
Table of Contents

Class ForgottenTenantServiceCollectionExtensions

Namespace
Microsoft.Extensions.DependencyInjection
Assembly
Stratara.EventSourcing.EntityFrameworkCore.dll

Registration of the store that keeps the deleted tenants of each projection in a read context.

public static class ForgottenTenantServiceCollectionExtensions
Inheritance
ForgottenTenantServiceCollectionExtensions
Inherited Members

Methods

AddStrataraForgottenTenants<TReadContext>(IServiceCollection)

Keeps the tenants that projections declaring IForgetsDeletedTenants have seen deleted in TReadContext. AddNpgsqlReadDbContextFactory already does this; call it for a read context registered another way. Requires a registered IDbContextFactory<TContext> for a read context derived from the framework's read context, which declares the table. A store registered before this call is kept.

public static IServiceCollection AddStrataraForgottenTenants<TReadContext>(this IServiceCollection services) where TReadContext : DbContext

Parameters

services IServiceCollection

The service collection.

Returns

IServiceCollection

The same service collection for chaining.

Type Parameters

TReadContext

The read context that holds the table of deleted tenants.

Examples

builder.Services
    .AddDbContextFactory<AppReadDbContext>(options => options.UseSqlite("Data Source=read.db"), ServiceLifetime.Scoped)
    .AddStrataraForgottenTenants<AppReadDbContext>();