diff --git a/docs/events/projections/aggregate-projections.md b/docs/events/projections/aggregate-projections.md index bd6011f903..2149dd3f86 100644 --- a/docs/events/projections/aggregate-projections.md +++ b/docs/events/projections/aggregate-projections.md @@ -184,6 +184,11 @@ public class Payment Just note that for single stream aggregations, your strong typed identifier types will need to wrap either a `Guid` or `string` depending on your application's `StreamIdentity`. +At this point, the `FetchForWriting` and `FetchForLatest` APIs do not directly support strongly typed identifiers and you +will have to just pass in the wrapped, primitive value like this: + +snippet: sample_use_fetch_for_writing_with_strong_typed_identifier + ## Aggregate Creation ::: tip diff --git a/src/EventSourcingTests/Aggregation/using_guid_based_strong_typed_id_for_aggregate_identity.cs b/src/EventSourcingTests/Aggregation/using_guid_based_strong_typed_id_for_aggregate_identity.cs index 7a24b7f8de..880c48f3d9 100644 --- a/src/EventSourcingTests/Aggregation/using_guid_based_strong_typed_id_for_aggregate_identity.cs +++ b/src/EventSourcingTests/Aggregation/using_guid_based_strong_typed_id_for_aggregate_identity.cs @@ -6,6 +6,7 @@ using EventSourcingTests.Projections; using JasperFx.Core; using JasperFx.Core.Reflection; +using Marten; using Marten.Events; using Marten.Events.Aggregation; using Marten.Events.Projections; @@ -87,6 +88,15 @@ public async Task can_utilize_strong_typed_id_in_with_inline_aggregations() payment.State.ShouldBe(PaymentState.Verified); } + #region sample_use_fetch_for_writing_with_strong_typed_identifier + + private async Task use_fetch_for_writing_with_strong_typed_identifier(PaymentId id, IDocumentSession session) + { + var stream = await session.Events.FetchForWriting(id.Value); + } + + #endregion + [Fact] public async Task can_utilize_strong_typed_id_with_async_aggregation() {