Skip to content

Commit e858733

Browse files
committed
Use IDomainEventStream for DomainEventsForCommit
1 parent 188c729 commit e858733

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Src/Xer.DomainDriven/AggregateRoot.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public abstract partial class AggregateRoot : Entity, IAggregateRoot
2121
/// Snapshot of the current domain events that are marked for commit.
2222
/// </summary>
2323
/// <returns>Readonly collection of domain events that are marked for commit.</returns>
24-
protected IEnumerable<IDomainEvent> DomainEventsForCommit => new ReadOnlyCollection<IDomainEvent>(_domainEventsForCommit.ToList());
24+
protected IDomainEventStream DomainEventsForCommit => new DomainEventStream(Id, _domainEventsForCommit);
2525

2626
#endregion Properties
2727

Src/Xer.DomainDriven/DomainEventStream.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public DomainEventStream(Guid aggreggateRootId)
4141

4242
/// <summary>
4343
/// Constructs a new instance of a read-only stream.
44+
/// This creates a copy of the provided domain events.
4445
/// </summary>
4546
/// <param name="aggregateRootId">Id of the aggregate root which owns this stream.</param>
4647
/// <param name="domainEvents">Domain events.</param>

0 commit comments

Comments
 (0)