public void RecordOutflow(Guid toId, decimal ammount)
        {
            var @event = new NewOutflowRecorded(Id, toId, new Outflow(ammount, DateTime.Now));

            Apply(@event);
            Append(@event);
        }
        public void Project(NewOutflowRecorded @event, IDocumentOperations operations)
        {
            var issue = operations.Load <AllAccountsSummaryView>(Guid.Empty) ?? new AllAccountsSummaryView();

            issue.Apply(@event);
            operations.Store(issue);
        }
 public void Apply(NewOutflowRecorded @event)
 {
     Balance -= @event.Outflow.Ammount;
 }
 private void Persist(AccountSummaryView view, NewOutflowRecorded @event)
 {
     view.ApplyEvent(@event);
 }
Esempio n. 5
0
 public void Apply(NewOutflowRecorded @event)
 {
     TotalBalance -= @event.Outflow.Amount;
     TotalTransactionsCount++;
 }