Class ProjectionAttribute
- Namespace
- Cratis.Chronicle.Projections
- Assembly
- Cratis.Chronicle.dll
Optional attribute used to adorn classes to configure a projection. The projection will have to implement IProjectionFor<TReadModel>.
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public sealed class ProjectionAttribute : Attribute
- Inheritance
-
ProjectionAttribute
- Inherited Members
Remarks
Initializes a new instance of ProjectionAttribute.
Constructors
ProjectionAttribute(string, string?)
Optional attribute used to adorn classes to configure a projection. The projection will have to implement IProjectionFor<TReadModel>.
public ProjectionAttribute(string id = "", string? eventSequence = null)
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 used in the projection definition.
Remarks
Initializes a new instance of ProjectionAttribute.
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 used in the projection definition. If all event types originate from the same event store (via EventStoreAttribute), the projection will automatically subscribe to the corresponding inbox event sequence.
Id
Gets the unique identifier for the reducer.
public ProjectionId Id { get; }