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
aggregateTAggregateThe aggregate instance whose property is being mutated.
eventFieldChangedEvent<TAggregate>The change event carrying property name and new value.
Type Parameters
TAggregateCLR type of the target aggregate.
Exceptions
- ArgumentException
Thrown when the property does not exist on
TAggregate.