private void Handle(BranchCreated br)
        {
            Log.Information("Added Branch: {Id}, {BranchCode}, {Address}",
                            br.Id, br.BranchCode, br.Address);

            //handle BranchCreated event
        }
Example #2
0
        public void CreateBranch(string userName, string branchName, DateTime commitedAtUtc)
        {
            // describe it as an event, rather than modifying the underlying model
            var @event = new BranchCreated(Guid.NewGuid(), commitedAtUtc, Id, userName, branchName);

            // mark this event as uncommitted, so that they can be picked up and persisted
            _uncommittedEvents.Add(@event);

            // apply this event to aggregate, which then updates the underlying model
            Handle(@event);
        }
Example #3
0
 private void Handle(BranchCreated branchCreated)
 {
     _branches.Add(branchCreated.NewBranchName);
 }
Example #4
0
 private void InvokeBranchCreated(RemoteRepositoryBranch branch)
 => BranchCreated?.Invoke(this, new RemoteReferenceEventArgs(branch));