Class RemovedWithAttribute<TEvent>
- Namespace
- Cratis.Chronicle.Projections.ModelBound
- Assembly
- Cratis.Chronicle.dll
Attribute used to indicate what event removes a read model or a child from a collection. When used on a class, it indicates the event that removes the read model instance. When used on a property or parameter, it indicates the event that removes a child from a collection.
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Property|AttributeTargets.Parameter, AllowMultiple = true)]
public sealed class RemovedWithAttribute<TEvent> : Attribute, IProjectionAnnotation, IRemovedWithAttribute, IKeyedAttribute, IEventBoundAttribute
Type Parameters
TEventThe type of event that removes the child.
- Inheritance
-
RemovedWithAttribute<TEvent>
- Implements
- Inherited Members
Constructors
RemovedWithAttribute(string?, string?)
Attribute used to indicate what event removes a read model or a child from a collection. When used on a class, it indicates the event that removes the read model instance. When used on a property or parameter, it indicates the event that removes a child from a collection.
public RemovedWithAttribute(string? key = null, string? parentKey = null)
Parameters
keystringOptional property name on the event that identifies the instance to remove. Defaults to WellKnownExpressions.EventSourceId.
parentKeystringOptional property name that identifies the parent (only used for children). Defaults to WellKnownExpressions.EventSourceId.
Properties
EventType
Gets the type of event this attribute is bound to.
public Type EventType { get; }
Property Value
Key
Gets the property name on the event that identifies the instance to remove.
public string Key { get; }
Property Value
ParentKey
Gets the property name that identifies the parent (only used for children).
public string ParentKey { get; }