Skip to content

Commit 63b0cf2

Browse files
committed
Fixed issue gregoryyoung#7 - AggregateRoot version never updated
The version of the AggregateRoot gets incremented whenever a new event is applied.
1 parent a085166 commit 63b0cf2

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@ Thumbs.db
2626
obj/
2727
[Rr]elease*/
2828
_ReSharper*/
29-
[Tt]est[Rr]esult*
29+
[Tt]est[Rr]esult*
30+
packages

SimpleCQRS/Domain.cs

+1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ private void ApplyChange(Event @event, bool isNew)
9292
{
9393
this.AsDynamic().Apply(@event);
9494
if(isNew) _changes.Add(@event);
95+
Version++;
9596
}
9697
}
9798

0 commit comments

Comments
 (0)