Class ReducerAttribute
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
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.
isActiveboolOptional 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
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; }