Table of Contents

Interface IMaterializedViewsBuilder

Namespace
Excalibur.EventSourcing.DependencyInjection
Assembly
Excalibur.EventSourcing.dll

Fluent builder interface for configuring materialized view services.

public interface IMaterializedViewsBuilder
Extension Methods

Examples

services.AddMaterializedViews(builder =>
{
    builder.AddBuilder<OrderSummaryView, OrderSummaryViewBuilder>()
           .AddBuilder<CustomerStatsView, CustomerStatsViewBuilder>()
           .UseStore<SqlServerMaterializedViewStore>();
});

Remarks

This interface follows the Microsoft-style fluent builder pattern for registering materialized view builders, stores, and processors.

All methods return this for method chaining, enabling a fluent configuration experience.

Properties

Services

Gets the service collection being configured.

IServiceCollection Services { get; }

Property Value

IServiceCollection

The IServiceCollection.

Methods

AddBuilder<TView, TBuilder>()

Registers a materialized view builder.

IMaterializedViewsBuilder AddBuilder<TView, TBuilder>() where TView : class, new() where TBuilder : class, IMaterializedViewBuilder<TView>

Returns

IMaterializedViewsBuilder

The builder for fluent configuration.

Type Parameters

TView

The view type.

TBuilder

The builder implementation type.

UseProcessor<TProcessor>()

Configures the materialized view processor implementation.

IMaterializedViewsBuilder UseProcessor<TProcessor>() where TProcessor : class, IMaterializedViewProcessor

Returns

IMaterializedViewsBuilder

The builder for fluent configuration.

Type Parameters

TProcessor

The processor implementation type.

UseStore(Func<IServiceProvider, IMaterializedViewStore>)

Configures the materialized view store with a factory function.

IMaterializedViewsBuilder UseStore(Func<IServiceProvider, IMaterializedViewStore> storeFactory)

Parameters

storeFactory Func<IServiceProvider, IMaterializedViewStore>

Factory function to create the store.

Returns

IMaterializedViewsBuilder

The builder for fluent configuration.

UseStore<TStore>()

Configures the materialized view store implementation.

IMaterializedViewsBuilder UseStore<TStore>() where TStore : class, IMaterializedViewStore

Returns

IMaterializedViewsBuilder

The builder for fluent configuration.

Type Parameters

TStore

The store implementation type.