Skip to content

Commit a7cb7a5

Browse files
authored
Fixes setting of correlation ID in AggregateRoot ctor (#133)
When using a root message as the correlation source in the ctor of AggregateRoot, the correlation ID would not be set correctly.
1 parent 22f04f1 commit a7cb7a5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/ReactiveDomain.Foundation/Domain/AggregateRoot.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ protected AggregateRoot() { }
1414
protected AggregateRoot(ICorrelatedMessage source = null)
1515
{
1616
if (source == null) { return; }
17-
_correlationId = source.CorrelationId;
18-
_causationId = source.MsgId;
17+
Source = source;
1918
}
2019

2120
internal void RegisterChild(ChildEntity childAggregate, out Action<object> raise, out EventRouter router)
@@ -27,7 +26,7 @@ internal void RegisterChild(ChildEntity childAggregate, out Action<object> raise
2726

2827
private Guid _correlationId;
2928
private Guid _causationId;
30-
ICorrelatedMessage ICorrelatedEventSource.Source
29+
public ICorrelatedMessage Source
3130
{
3231
get
3332
{

0 commit comments

Comments
 (0)