Skip to content

Commit 2e97d85

Browse files
committed
Little addition to docs on strong typed identifiers with FetchForWriting
1 parent f27c4a9 commit 2e97d85

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

docs/events/projections/aggregate-projections.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,11 @@ public class Payment
184184
Just note that for single stream aggregations, your strong typed identifier types will need to wrap either a `Guid` or
185185
`string` depending on your application's `StreamIdentity`.
186186

187+
At this point, the `FetchForWriting` and `FetchForLatest` APIs do not directly support strongly typed identifiers and you
188+
will have to just pass in the wrapped, primitive value like this:
189+
190+
snippet: sample_use_fetch_for_writing_with_strong_typed_identifier
191+
187192
## Aggregate Creation
188193

189194
::: tip

src/EventSourcingTests/Aggregation/using_guid_based_strong_typed_id_for_aggregate_identity.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using EventSourcingTests.Projections;
77
using JasperFx.Core;
88
using JasperFx.Core.Reflection;
9+
using Marten;
910
using Marten.Events;
1011
using Marten.Events.Aggregation;
1112
using Marten.Events.Projections;
@@ -87,6 +88,15 @@ public async Task can_utilize_strong_typed_id_in_with_inline_aggregations()
8788
payment.State.ShouldBe(PaymentState.Verified);
8889
}
8990

91+
#region sample_use_fetch_for_writing_with_strong_typed_identifier
92+
93+
private async Task use_fetch_for_writing_with_strong_typed_identifier(PaymentId id, IDocumentSession session)
94+
{
95+
var stream = await session.Events.FetchForWriting<Payment>(id.Value);
96+
}
97+
98+
#endregion
99+
90100
[Fact]
91101
public async Task can_utilize_strong_typed_id_with_async_aggregation()
92102
{

0 commit comments

Comments
 (0)