Table of Contents

Interface IProjectionConfiguration<TProjection>

Namespace
Excalibur.EventSourcing.Projections
Assembly
Excalibur.EventSourcing.dll

Marker interface for convention-based projection registration via assembly scanning. Implement this interface to register projections when using AddProjectionsFromAssembly.

public interface IProjectionConfiguration<TProjection> where TProjection : class, new()

Type Parameters

TProjection

The projection state type.

Remarks

This enables convention-based registration instead of individual AddProjection<T> calls:

// Registration
builder.AddProjectionsFromAssembly(typeof(OrderSummary).Assembly);

// Configuration class (discovered automatically) public class OrderSummaryProjectionConfig : IProjectionConfiguration<OrderSummary> { public void Configure(IProjectionBuilder<OrderSummary> builder) { builder.Async() .When<OrderPlaced>((proj, e) => { proj.Total = e.Amount; }) .When<OrderShipped>((proj, e) => { proj.ShippedAt = e.ShippedAt; }); } }

Methods

Configure(IProjectionBuilder<TProjection>)

Configures the projection's mode, event handlers, and options.

void Configure(IProjectionBuilder<TProjection> builder)

Parameters

builder IProjectionBuilder<TProjection>

The projection builder to configure.