Skip to content

Instantly share code, notes, and snippets.

Created February 15, 2018 02:16
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
public BankAccountGrain()
var settings = ConnectionSettings
_conn = EventStoreConnection.Create(settings, new IPEndPoint(IPAddress.Loopback, Defaultport));
public override async Task OnActivateAsync()
_stream = $"{GetType().Name}-{this.GetPrimaryKey()}";
await _conn.ConnectAsync();
StreamEventsSlice currentSlice;
var nextSliceStart = StreamPosition.Start;
currentSlice = await _conn.ReadStreamEventsForwardAsync(_stream, nextSliceStart, 200, false);
foreach (var evnt in currentSlice.Events)
nextSliceStart = (int)currentSlice.NextEventNumber;
} while (!currentSlice.IsEndOfStream);
await ConfirmEvents();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment