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
| Name | Signature | Synopsis |
|---|---|---|
| AddAggregate | this.AddAggregate | Register an aggregate. |
| AddProjection | this.AddProjection | DI variant of the filtered single-event handler overload. |
| AddProjection | this.AddProjection | DI variant of the single-event handler overload. |
| AddProjection | this.AddProjection | Register the read-model projection, building the handler (and resuming offset) from DI. |
| AddProjection | this.AddProjection | 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. |
| AddProjection | this.AddProjection | 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. |
| AddProjection | this.AddProjection | Register the read-model projection, resuming from the given offset (default 0). |
| AddSaga | this.AddSaga | Register a saga and the event that starts it. |
| AddTransactionalProjection | this.AddTransactionalProjection | Register a transactional projection with journal-wide CatchUpAsync support. |
| WithAkkaLogging | this.WithAkkaLogging | Enable Akka's internal logging (FCQRS ships it OFF). |
| WithDefaultSnapshotPolicy | this.WithDefaultSnapshotPolicy | Set the builder-wide default snapshot cadence: every aggregate/saga whose own SnapshotPolicy is Default uses this instead. |
| WithEventUpcaster | this.WithEventUpcaster | Register a deterministic, one-to-one historical event conversion. |
| WithJournalTypes | this.WithJournalTypes | 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). |
| WithMessageFlowLogging | this.WithMessageFlowLogging | 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. |
| WithPayloadDiagnostics | this.WithPayloadDiagnostics | Whether message *payloads* appear in diagnostics detail — the span tags (command.type / event.type) and the message-flow log lines. |
| Services | this.Services | The underlying service collection (so you can keep chaining .Add… on it). |
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
DI variant of the filtered single-event handler overload.
Parameters
| Name | Type | Description |
|---|---|---|
| handler | Func<IServiceProvider, Func<int64, obj, Notify>> | |
| lastOffset | Func<IServiceProvider, int64> |
Returns
FcqrsBuilder
DI variant of the single-event handler overload.
Parameters
| Name | Type | Description |
|---|---|---|
| handler | Func<IServiceProvider, Action<int64, obj>> | |
| lastOffset | Func<IServiceProvider, int64> |
Returns
FcqrsBuilder
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
| Name | Type | Description |
|---|---|---|
| handler | Func<IServiceProvider, Func<int64, obj, IList<IMessageWithCID>>> | |
| lastOffset | Func<IServiceProvider, int64> |
Returns
FcqrsBuilder
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
| Name | Type | Description |
|---|---|---|
| handler | Func<int64, obj, Notify> | |
| lastOffset | int64 |
Returns
FcqrsBuilder
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
| Name | Type | Description |
|---|---|---|
| handler | Action<int64, obj> | |
| lastOffset | int64 |
Returns
FcqrsBuilder
Register the read-model projection, resuming from the given offset (default 0).
Parameters
| Name | Type | Description |
|---|---|---|
| handler | Func<int64, obj, IList<IMessageWithCID>> | |
| lastOffset | int64 |
Returns
FcqrsBuilder
Register a saga and the event that starts it. `create` builds the saga
(use sp.AggregateFactory<T>() to reference the aggregates it coordinates);
`startOn` decides which originator events spawn an instance.
Parameters
| Name | Type | Description |
|---|---|---|
| create | Func<IServiceProvider, 'TSaga> | |
| startOn | Func<obj, bool> |
Returns
FcqrsBuilder
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
| Name | Type | Description |
|---|---|---|
| options | TransactionalProjectionOptions | |
| handler | Func<DbConnection, DbTransaction, EventEnvelope, Task> |
Returns
FcqrsBuilder
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
| Name | Type | Description |
|---|---|---|
| level | AkkaLogLevel | |
| includeStdout | bool |
Returns
FcqrsBuilder
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
| Name | Type | Description |
|---|---|---|
| policy | SnapshotPolicy |
Returns
FcqrsBuilder
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
| Name | Type | Description |
|---|---|---|
| convert | Func<'Old, 'New> |
Returns
FcqrsBuilder
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
| Name | Type | Description |
|---|---|---|
| configure | Action<JournalTypeMapBuilder> |
Returns
FcqrsBuilder
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
| Name | Type | Description |
|---|---|---|
| enabled | bool |
Returns
FcqrsBuilder
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
| Name | Type | Description |
|---|---|---|
| enabled | bool |
Returns
FcqrsBuilder