FcqrsBuilderType

PackageFCQRS
Fluent registration builder. Each AddXxx records a step to run at startup and, where relevant, registers the resolved piece (Handler, refs, subscription) in DI. These services support constructor injection before startup; use their operations after FCQRS's hosted service starts. Returned by IServiceCollection.AddFcqrs.

Specification

Kind
Type
Members
16
Examples
0
AddAggregateSignature
this.AddAggregate
AddProjectionSignature
this.AddProjection
AddProjectionSignature
this.AddProjection
AddProjectionSignature
this.AddProjection
AddProjectionSignature
this.AddProjection

Summary

NameSignatureSynopsis
AddAggregatethis.AddAggregateRegister an aggregate.
AddProjectionthis.AddProjectionDI variant of the filtered single-event handler overload.
AddProjectionthis.AddProjectionDI variant of the single-event handler overload.
AddProjectionthis.AddProjectionRegister the read-model projection, building the handler (and resuming offset) from DI.
AddProjectionthis.AddProjectionRegister the read-model projection with a filtered single-event handler: the handler updates the read model and returns Publish/Suppress per event to control whether it wakes subscribers.
AddProjectionthis.AddProjectionRegister the read-model projection with a single-event handler: the handler just updates the read model (returns void); each aggregate event is then published to subscribers as-is.
AddProjectionthis.AddProjectionRegister the read-model projection, resuming from the given offset (default 0).
AddSagathis.AddSagaRegister a saga and the event that starts it.
AddTransactionalProjectionthis.AddTransactionalProjectionRegister a transactional projection with journal-wide CatchUpAsync support.
WithAkkaLoggingthis.WithAkkaLoggingEnable Akka's internal logging (FCQRS ships it OFF).
WithDefaultSnapshotPolicythis.WithDefaultSnapshotPolicySet the builder-wide default snapshot cadence: every aggregate/saga whose own SnapshotPolicy is Default uses this instead.
WithEventUpcasterthis.WithEventUpcasterRegister a deterministic, one-to-one historical event conversion.
WithJournalTypesthis.WithJournalTypesRegister stable journal names for payload types: manifests become "fcqrs:ev(doc.event)" instead of CLR AssemblyQualifiedNames, so types can be renamed/moved freely (update the mapping; old rows keep reading).
WithMessageFlowLoggingthis.WithMessageFlowLoggingThe message-flow narrative — which command reached which aggregate and what it yielded, saga state transitions, the commands sagas issue — is written at Information level to the "FCQRS.MessageFlow" category and is ON by default: these lines describe your application's messages, not FCQRS internals.
WithPayloadDiagnosticsthis.WithPayloadDiagnosticsWhether message *payloads* appear in diagnostics detail — the span tags (command.type / event.type) and the message-flow log lines.
Servicesthis.ServicesThe underlying service collection (so you can keep chaining .Add… on it).

AddAggregate

this.AddAggregate
Member
Register an aggregate. The shard is constructed via DI (ctor args resolved from the container) and Init'd at startup; its Handler and AggregateRefs are registered so endpoints/sagas can resolve them. Hosted services may inject these handles in their constructors and invoke them after FCQRS starts.

Returns

FcqrsBuilder

AddProjection

this.AddProjection
Member
DI variant of the filtered single-event handler overload.

Parameters

NameTypeDescription
handlerFunc<IServiceProvider, Func<int64, obj, Notify>>
lastOffsetFunc<IServiceProvider, int64>

Returns

FcqrsBuilder

AddProjection

this.AddProjection
Member
DI variant of the single-event handler overload.

Parameters

NameTypeDescription
handlerFunc<IServiceProvider, Action<int64, obj>>
lastOffsetFunc<IServiceProvider, int64>

Returns

FcqrsBuilder

AddProjection

this.AddProjection
Member
Register the read-model projection, building the handler (and resuming offset) from DI. Use this overload when the projection needs services — e.g. an ILoggerFactory — so it resolves them the same way the actor system does.

Parameters

NameTypeDescription
handlerFunc<IServiceProvider, Func<int64, obj, IList<IMessageWithCID>>>
lastOffsetFunc<IServiceProvider, int64>

Returns

FcqrsBuilder

AddProjection

this.AddProjection
Member
Register the read-model projection with a filtered single-event handler: the handler updates the read model and returns Publish/Suppress per event to control whether it wakes subscribers. The middle ground between the void overload (publish all) and the list-returning one (full control) — e.g. suppress an intermediate event so read-your-writes wakes only on the final.

Parameters

NameTypeDescription
handlerFunc<int64, obj, Notify>
lastOffsetint64

Returns

FcqrsBuilder

AddProjection

this.AddProjection
Member
Register the read-model projection with a single-event handler: the handler just updates the read model (returns void); each aggregate event is then published to subscribers as-is. Use the list-returning overload when notifications must be filtered — e.g. suppressing intermediate events so read-your-writes only wakes on the final one.

Parameters

NameTypeDescription
handlerAction<int64, obj>
lastOffsetint64

Returns

FcqrsBuilder

AddProjection

this.AddProjection
Member
Register the read-model projection, resuming from the given offset (default 0).

Parameters

NameTypeDescription
handlerFunc<int64, obj, IList<IMessageWithCID>>
lastOffsetint64

Returns

FcqrsBuilder

AddSaga

this.AddSaga
Member
Register a saga and the event that starts it. `create` builds the saga (use sp.AggregateFactory&lt;T&gt;() to reference the aggregates it coordinates); `startOn` decides which originator events spawn an instance.

Parameters

NameTypeDescription
createFunc<IServiceProvider, 'TSaga>
startOnFunc<obj, bool>

Returns

FcqrsBuilder

AddTransactionalProjection

this.AddTransactionalProjection
Member
Register a transactional projection with journal-wide CatchUpAsync support. The handler must write through the supplied connection and transaction and await all database work. FCQRS commits updates with durable contiguous progress. Resolve FCQRS.Projections.IProjection from DI to wait after an aggregate reply. Ordering is per persistence ID, and unprocessed journal history must be retained.

Parameters

NameTypeDescription
optionsTransactionalProjectionOptions
handlerFunc<DbConnection, DbTransaction, EventEnvelope, Task>

Returns

FcqrsBuilder

WithAkkaLogging

this.WithAkkaLogging
Member
Enable Akka's internal logging (FCQRS ships it OFF). `level` maps to akka.loglevel; by default akka.stdout-loglevel is set to the same value. FCQRS's own logs are unaffected — they follow the host's ILoggerFactory.

Parameters

NameTypeDescription
levelAkkaLogLevel
includeStdoutbool

Returns

FcqrsBuilder

WithDefaultSnapshotPolicy

this.WithDefaultSnapshotPolicy
Member
Set the builder-wide default snapshot cadence: every aggregate/saga whose own SnapshotPolicy is Default uses this instead. Per-entity overrides (Every n / NoSnapshots) always win; leaving this unset keeps the config key (config:akka:persistence:snapshot-version-count) / 30 fallback.

Parameters

NameTypeDescription
policySnapshotPolicy

Returns

FcqrsBuilder

WithEventUpcaster

this.WithEventUpcaster
Member
Register a deterministic, one-to-one historical event conversion. Chained conversions follow declared envelope payload types. Duplicate source registrations and cycles fail. The host installs these conversions before initializing aggregates, sagas, or projections. Each actor system has its own registry, fixed for its lifetime. Only FCQRS journal reads are converted; stored envelopes, live messages, and application-owned snapshot state are unchanged. Keep old payload types readable and register readers before deploying writers. Finish builder registrations before building or resolving the host; resolving IActor fixes this configuration. Converters may run concurrently and must be thread-safe.

Parameters

NameTypeDescription
convertFunc<'Old, 'New>

Returns

FcqrsBuilder

WithJournalTypes

this.WithJournalTypes
Member
Register stable journal names for payload types: manifests become "fcqrs:ev(doc.event)" instead of CLR AssemblyQualifiedNames, so types can be renamed/moved freely (update the mapping; old rows keep reading).

Parameters

NameTypeDescription
configureAction<JournalTypeMapBuilder>

Returns

FcqrsBuilder

WithMessageFlowLogging

this.WithMessageFlowLogging
Member
The message-flow narrative — which command reached which aggregate and what it yielded, saga state transitions, the commands sagas issue — is written at Information level to the "FCQRS.MessageFlow" category and is ON by default: these lines describe your application's messages, not FCQRS internals. Turn it off here (a process-wide switch), or filter the category in your logging configuration.

Parameters

NameTypeDescription
enabledbool

Returns

FcqrsBuilder

WithPayloadDiagnostics

this.WithPayloadDiagnostics
Member
Whether message *payloads* appear in diagnostics detail — the span tags (command.type / event.type) and the message-flow log lines. ON by default. Span *names* are always low-cardinality case names regardless, so this never affects tracing rules or grouping. Turn it off for sensitive domains: tags and log lines then carry the case name only.

Parameters

NameTypeDescription
enabledbool

Returns

FcqrsBuilder

Services

this.Services
Member
The underlying service collection (so you can keep chaining .Add… on it).

Returns

IServiceCollection