Header menu logo FCQRS

FcqrsBuilder Type

Fluent registration builder. Each AddXxx records a step to run at startup and, where relevant, registers the resolved piece (Handler, refs, subscription) in DI. Returned by IServiceCollection.AddFcqrs.

Instance members

Instance member Description

this.AddAggregate

Full Usage: this.AddAggregate

Returns: FcqrsBuilder

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.

Returns: FcqrsBuilder

this.AddProjection

Full Usage: this.AddProjection

Parameters:
Returns: FcqrsBuilder

DI variant of the filtered single-event handler overload.

handler : Func<IServiceProvider, Func<int64, obj, Notify>>
lastOffset : Func<IServiceProvider, int>
Returns: FcqrsBuilder

this.AddProjection

Full Usage: this.AddProjection

Parameters:
Returns: FcqrsBuilder

DI variant of the single-event handler overload.

handler : Func<IServiceProvider, Action<int64, obj>>
lastOffset : Func<IServiceProvider, int>
Returns: FcqrsBuilder

this.AddProjection

Full Usage: this.AddProjection

Parameters:
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.

handler : Func<IServiceProvider, Func<int64, obj, IList<IMessageWithCID>>>
lastOffset : Func<IServiceProvider, int>
Returns: FcqrsBuilder

this.AddProjection

Full Usage: this.AddProjection

Parameters:
    handler : Func<int64, obj, Notify>
    ?lastOffset : int

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.

handler : Func<int64, obj, Notify>
?lastOffset : int
Returns: FcqrsBuilder

this.AddProjection

Full Usage: this.AddProjection

Parameters:
    handler : Action<int64, obj>
    ?lastOffset : int

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.

handler : Action<int64, obj>
?lastOffset : int
Returns: FcqrsBuilder

this.AddProjection

Full Usage: this.AddProjection

Parameters:
Returns: FcqrsBuilder

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

handler : Func<int64, obj, IList<IMessageWithCID>>
?lastOffset : int
Returns: FcqrsBuilder

this.AddSaga

Full Usage: this.AddSaga

Parameters:
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.

create : Func<IServiceProvider, 'TSaga>
startOn : Func<obj, bool>
Returns: FcqrsBuilder

this.Services

Full Usage: this.Services

Returns: IServiceCollection

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

Returns: IServiceCollection

this.WithAkkaLogging

Full Usage: this.WithAkkaLogging

Parameters:
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.

level : AkkaLogLevel
?includeStdout : bool
Returns: FcqrsBuilder

this.WithDefaultSnapshotPolicy

Full Usage: this.WithDefaultSnapshotPolicy

Parameters:
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.

policy : SnapshotPolicy
Returns: FcqrsBuilder

this.WithJournalTypes

Full Usage: this.WithJournalTypes

Parameters:
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).

configure : Action<JournalTypeMapBuilder>
Returns: FcqrsBuilder

Type something to start searching.