Skip to main content
Table of Contents

Class ProjectionsUnitOfWork<TDbContext>

Namespace
Stratara.EventSourcing.EntityFrameworkCore.ReadStore
Assembly
Stratara.EventSourcing.EntityFrameworkCore.dll

Read-side unit of work for projection writers — extends ReadUnitOfWork<TDbContext> with factory methods for projection-specific repositories such as ITenantRepository.

public class ProjectionsUnitOfWork<TDbContext> : ReadUnitOfWork<TDbContext>, IProjectionsUnitOfWork, IReadUnitOfWork, IUnitOfWork where TDbContext : DbContext, IReadDbContext

Type Parameters

TDbContext

The concrete read-store DbContext type.

Inheritance
UnitOfWork<TDbContext>
ReadUnitOfWork<TDbContext>
ProjectionsUnitOfWork<TDbContext>
Implements
Inherited Members
Extension Methods

Constructors

ProjectionsUnitOfWork(IDbContextFactory<TDbContext>)

Read-side unit of work for projection writers — extends ReadUnitOfWork<TDbContext> with factory methods for projection-specific repositories such as ITenantRepository.

public ProjectionsUnitOfWork(IDbContextFactory<TDbContext> contextFactory)

Parameters

contextFactory IDbContextFactory<TDbContext>

Factory used to create a new DbContext per transaction.

Methods

CreateTenantRepository(ITransaction)

Creates an ITenantRepository bound to the supplied read transaction.

public ITenantRepository CreateTenantRepository(ITransaction transaction)

Parameters

transaction ITransaction

An active read transaction obtained from StartAsync(CancellationToken).

Returns

ITenantRepository