Class SetFromContextAttribute<TEvent>
- Namespace
- Cratis.Chronicle.Projections.ModelBound
- Assembly
- Cratis.Chronicle.dll
Attribute used to indicate that a property value should be set from an event context property.
[AttributeUsage(AttributeTargets.Property|AttributeTargets.Parameter, AllowMultiple = true)]
public sealed class SetFromContextAttribute<TEvent> : Attribute, IProjectionAnnotation, ISetFromContextAttribute, IEventBoundAttribute
Type Parameters
TEventThe type of event to set from.
- Inheritance
-
SetFromContextAttribute<TEvent>
- Implements
- Inherited Members
Constructors
SetFromContextAttribute(string?)
Attribute used to indicate that a property value should be set from an event context property.
public SetFromContextAttribute(string? contextPropertyName = null)
Parameters
contextPropertyNamestringOptional name of the property on the event context. If not specified, uses the model property name.
Properties
ContextPropertyName
Gets the name of the property on the event context.
public string? ContextPropertyName { get; }
Property Value
EventType
Gets the type of event this attribute is bound to.
public Type EventType { get; }