Class ReducerAttribute
- Namespace
- Cratis.Chronicle.Reducers
- Assembly
- Cratis.Chronicle.dll
Configures a classic reducer or a read model declaring static self-reduction methods.
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public sealed class ReducerAttribute : Attribute
- Inheritance
-
ReducerAttribute
- Inherited Members
- Extension Methods
Remarks
Initializes a new instance of ReducerAttribute.
Constructors
ReducerAttribute(string, string?, bool)
Configures a classic reducer or a read model declaring static self-reduction methods.
public ReducerAttribute(string id = "", string? eventSequence = null, bool isActive = true)
Parameters
idstringOptional identifier. If not specified, it will default to the fully qualified type name.
eventSequencestringOptional the name of the event sequence to observe. When not specified, the event sequence is inferred from the event types handled by the reducer.
isActiveboolWhether the observer runs actively on the Kernel. False does not enable passive read-model reads; use ReadModels.PassiveAttribute on the model for those.
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
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
IsActive
Gets whether or not the reducer should be actively running on the Kernel.
public bool IsActive { get; }