private void Handle(BranchCreated br) { Log.Information("Added Branch: {Id}, {BranchCode}, {Address}", br.Id, br.BranchCode, br.Address); //handle BranchCreated event }
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); }
private void Handle(BranchCreated branchCreated) { _branches.Add(branchCreated.NewBranchName); }
private void InvokeBranchCreated(RemoteRepositoryBranch branch) => BranchCreated?.Invoke(this, new RemoteReferenceEventArgs(branch));