public MakeStateRealize ( ITrustedSystemEvent thisEventTypeHappened ) : void | ||
thisEventTypeHappened | ITrustedSystemEvent | |
return | void |
/// <summary> Make Aggregate realize the event happened /// by applying it to the state and adding to /// the list of uncommitted events</summary> /// <param name="eventThatHappened"></param> void Apply(ITrustedSystemEvent eventThatHappened) { // update Agg's in-memory state so if a behavior (method) has // multiple steps, each subsequent step has up-to-date state to operate on _aggState.MakeStateRealize(eventThatHappened); // update Agg's public collection of change causing Events so the // AppService can use it to persist AggState as appended Events to this Agg's Event Stream EventsCausingChanges.Add((Event)eventThatHappened); }
public static TrustedSystemState BuildStateFromEventHistory(IEnumerable <Event> events) { var aggState = new TrustedSystemState(); foreach (var eventThatHappened in events) { aggState.MakeStateRealize((ITrustedSystemEvent)eventThatHappened); } return(aggState); }
public static TrustedSystemState BuildStateFromEventHistory(IEnumerable<Event> events) { var aggState = new TrustedSystemState(); foreach (var eventThatHappened in events) { aggState.MakeStateRealize((ITrustedSystemEvent) eventThatHappened); } return aggState; }