Table of Contents

Class ProjectionFilterBuilder

Namespace
Excalibur.EventSourcing
Assembly
Excalibur.EventSourcing.Abstractions.dll

Fluent builder for constructing type-safe projection query filter dictionaries.

public sealed class ProjectionFilterBuilder
Inheritance
ProjectionFilterBuilder
Inherited Members

Remarks

Provides a compile-time safe alternative to manually constructing filter dictionaries with operator-suffixed string keys. The builder produces the same IDictionary<string, object> format consumed by QueryAsync(IDictionary<string, object>?, QueryOptions?, CancellationToken) and related methods.

Example usage:

var filters = new ProjectionFilterBuilder()
    .Where("price").GreaterThan(100)
    .Where("status").EqualTo("active")
    .Where("tags").In(new[] { "electronics", "sale" })
    .Build();

var results = await store.QueryAsync(filters, null, ct);

Methods

Build()

Builds the filter dictionary from the accumulated conditions.

public IDictionary<string, object> Build()

Returns

IDictionary<string, object>

An IDictionary<TKey, TValue> suitable for passing to QueryAsync(IDictionary<string, object>?, QueryOptions?, CancellationToken) and related methods. Returns an empty dictionary if no conditions have been added.

Where(string)

Starts a filter condition for the specified property.

public ProjectionFilterClause Where(string propertyName)

Parameters

propertyName string

The property name to filter on.

Returns

ProjectionFilterClause

A ProjectionFilterClause for specifying the operator and value.

Exceptions

ArgumentNullException

Thrown when propertyName is null.

ArgumentException

Thrown when propertyName is empty or whitespace.