Skip to content

Commit

Permalink
can now showcase revision checks from ESDB! 1337 😎
Browse files Browse the repository at this point in the history
  • Loading branch information
erikshafer committed May 23, 2024
1 parent 9161c2d commit 229e19e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions StudentEnrollment03.Esdb/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ await client.AppendToStreamAsync(
// Okay, taking that StreamResult we're going to make it a List of ResolvedEvents.
var eventStream = await streamResult.ToListAsync();
// Get the last event's event number.
var lastEventInStream = eventStream.Last().Event.EventNumber.ToUInt64();
var lastEventNumFromStream = eventStream.Last().Event.EventNumber.ToUInt64();

// Append another event. This time let's make sure no one has appended to (AKA updated) the stream.
await client.AppendToStreamAsync(
streamId,
new StreamRevision(lastEventInStream), // checking against expected revision number
new StreamRevision(lastEventNumFromStream), // checking against expected revision number
new[] { withdrawn },
cancellationToken: default
);
Expand Down

0 comments on commit 229e19e

Please sign in to comment.