Skip to main content
Table of Contents

Class FieldChangedEventExtensions

Namespace
Stratara.Shared.EventSourcing.Extensions
Assembly
Stratara.Shared.dll

Extension helpers that apply a generic FieldChangedEvent<TAggregate> to its target aggregate by reflecting the named property onto the live aggregate instance.

public static class FieldChangedEventExtensions
Inheritance
FieldChangedEventExtensions
Inherited Members

Methods

ApplyPropertyChanged<TAggregate>(TAggregate, FieldChangedEvent<TAggregate>)

Applies a FieldChangedEvent<TAggregate> to aggregate by invoking the cached property setter for PropertyName.

public static void ApplyPropertyChanged<TAggregate>(this TAggregate aggregate, FieldChangedEvent<TAggregate> @event) where TAggregate : notnull

Parameters

aggregate TAggregate

The aggregate instance whose property is being mutated.

event FieldChangedEvent<TAggregate>

The change event carrying property name and new value.

Type Parameters

TAggregate

CLR type of the target aggregate.

Exceptions

ArgumentException

Thrown when the property does not exist on TAggregate.