public void SaveRunningAggregate(TransactionAggregates runningAggregate) { if (this.RunningAggregate != null) { throw new Exception("Running aggregate is already set"); } var cloned = runningAggregate.Clone(); this.RunningAggregate = cloned; }
public void Add(TransactionAggregates otherAggregate) { foreach (var runningTotalByReason in otherAggregate.TotalsByReason) { this.AddToTotalByReason(runningTotalByReason.Key, runningTotalByReason.Value); } this.PositiveTotal += otherAggregate.PositiveTotal; this.NegativeTotal += otherAggregate.NegativeTotal; this.Count += otherAggregate.Count; }