Skip to content

Commit 6826225

Browse files
committed
Update README - add sample view of Event Store
Return null from SqlStreamAggregateStore.Load method if domain events are not exist
1 parent 445cad7 commit 6826225

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

README.md

+11
Original file line numberDiff line numberDiff line change
@@ -1630,6 +1630,17 @@ internal class SubscriptionDetailsProjector : ProjectorBase, IProjector
16301630
}
16311631

16321632
```
1633+
#### Sample view of Event Store
1634+
1635+
Sample *Event Store* view after execution of SubscriptionLifecycleTests Integration Test which includes following steps:
1636+
1. Creating Price List
1637+
2. Buying Subscription
1638+
3. Renewing Subscription
1639+
4. Expiring Subscription
1640+
1641+
looks like this (*SQL Stream Store* table - *payments.Messages*):
1642+
1643+
![](docs/Images/ES_event_store_db_sample.png)
16331644

16341645
## 4. Technology
16351646

56.9 KB
Loading

src/Modules/Payments/Infrastructure/AggregateStore/SqlStreamAggregateStore.cs

+5
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ public async Task<T> Load<T>(AggregateId<T> aggregateId) where T : AggregateRoot
6969
}
7070
} while (!readStreamPage.IsEnd);
7171

72+
if (!domainEvents.Any())
73+
{
74+
return null;
75+
}
76+
7277
var aggregate = (T)Activator.CreateInstance(typeof(T), true);
7378

7479
aggregate.Load(domainEvents);

0 commit comments

Comments
 (0)