Class FromEventAttribute<TEvent>

Namespace
Cratis.Chronicle.Projections.ModelBound
Assembly
Cratis.Chronicle.dll

Attribute used at class level to indicate that properties should be set from an event by convention.

[AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct, AllowMultiple = true)]
public sealed class FromEventAttribute<TEvent> : Attribute, IProjectionAnnotation, IFromEventAttribute, IEventBoundAttribute, IKeyedAttribute

Type Parameters

TEvent

The type of event to set from.

Inheritance
FromEventAttribute<TEvent>
Implements
Inherited Members
Extension Methods

Constructors

FromEventAttribute(string?, string?)

Attribute used at class level to indicate that properties should be set from an event by convention.

public FromEventAttribute(string? key = null, string? parentKey = null)

Parameters

key string

Optional property name on the event that identifies the read model instance. Defaults to using the event source identifier.

parentKey string

Optional property name on the event that identifies the parent read model instance for child relationships.

Properties

ConstantKey

Gets or sets a constant value to use as the key. All events of this type will update the same read model instance.

public string? ConstantKey { get; init; }

Property Value

string

EventType

Gets the type of event this attribute projects from.

public Type EventType { get; }

Property Value

Type

Key

Gets the property name on the event that identifies the read model instance.

public string? Key { get; }

Property Value

string

ParentKey

Gets the property name on the event that identifies the parent read model instance for child relationships.

public string? ParentKey { get; }

Property Value

string