Table of Contents

Class ReducerAttribute

Namespace
Cratis.Chronicle.Reducers
Assembly
Cratis.Chronicle.dll

Optional attribute used to adorn classes to configure a reducer. The reducer will have to implement IReducerFor<TReadModel>.

[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public sealed class ReducerAttribute : Attribute
Inheritance
ReducerAttribute
Inherited Members

Remarks

Initializes a new instance of ReducerAttribute.

Constructors

ReducerAttribute(string, string?, bool)

Optional attribute used to adorn classes to configure a reducer. The reducer will have to implement IReducerFor<TReadModel>.

public ReducerAttribute(string id = "", string? eventSequence = null, bool isActive = true)

Parameters

id string

Optional identifier. If not specified, it will default to the fully qualified type name.

eventSequence string

Optional the name of the event sequence to observe. When not specified, the event sequence is inferred from the event types handled by the reducer.

isActive bool

Optional whether or not the reducer is active or not. If its passive, it won't run actively on the Kernel.

Remarks

Initializes a new instance of ReducerAttribute.

Properties

EventSequenceId

Gets the explicit event sequence identifier, or null if not specified.

public EventSequenceId? EventSequenceId { get; }

Property Value

EventSequenceId

Remarks

When null, the event sequence is inferred from the event types handled by the reducer. If all handled event types originate from the same event store (via EventStoreAttribute), the reducer will automatically subscribe to the corresponding inbox event sequence.

Id

Gets the unique identifier for the reducer.

public ReducerId Id { get; }

Property Value

ReducerId

IsActive

Gets whether or not the reducer should be actively running on the Kernel.

public bool IsActive { get; }

Property Value

bool