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 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. |
| AddSaga | this.AddSaga | Register a saga. |
| 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 type names, 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<obj, Notify>> | |
| name | string |
Returns
FcqrsBuilder
DI variant of the single-event handler overload.
Parameters
| Name | Type | Description |
|---|---|---|
| handler | Func<IServiceProvider, Action<obj>> | |
| name | string |
Returns
FcqrsBuilder
Register the read-model projection, building the handler from DI. Use this overload
when the projection needs services, e.g. an ILoggerFactory.
Parameters
| Name | Type | Description |
|---|---|---|
| handler | Func<IServiceProvider, Func<obj, IList<IMessageWithCID>>> | |
| name | string |
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.
Parameters
| Name | Type | Description |
|---|---|---|
| handler | Func<obj, Notify> | |
| name | string |
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<obj> | |
| name | string |
Returns
FcqrsBuilder
Register the read-model projection. It follows each aggregate's and saga's own sequence
numbers, so it never skips a stored event. Without a name it keeps its progress in memory
and reads the whole journal at each start, for a read model kept in memory. With a name it
stores its progress in the journal database and resumes, and a handler can see an event
again after a crash. A handler that throws terminates the process. The handler returns the
notifications to publish. Resolve FCQRS.Projections.IProjection to wait for it.
Parameters
| Name | Type | Description |
|---|---|---|
| handler | Func<obj, IList<IMessageWithCID>> | |
| name | string |
Returns
FcqrsBuilder
Register a saga. `create` builds it; use sp.AggregateFactory<T>() to reference the
aggregates it sends commands to. The saga's StartsOn decides which originator events
start an instance. C# infers TData, TState and TEvent from the saga class `create`
returns, so a call names no type arguments:
.AddSaga(sp => new Transfer(sp.AggregateFactory<Account>()))
Parameters
| Name | Type | Description |
|---|---|---|
| create | Func<IServiceProvider, Saga<'TData, 'TState, 'TEvent>> |
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 type names, 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