Hi All
Just trying to get started using the .Net Api Quick Start Sample and code below. Seems I can connect ok, but get exception calling AppendToStreamAsync. Unfortunately the Exception just states that one
or more exceptions occurred and connection was closed. Any help would really be appreciated.
Thank you
var connection = EventStoreConnection.Create(“ConnectTo=tcp://admin:changeit@localhost:1113; HeartBeatTimeout=500”);
// Don’t forget to tell the connection to connect!
connection.ConnectAsync().Wait();
var myEvent = new EventData(
Guid.NewGuid(),
“testEvent”,
false,
Encoding.UTF8.GetBytes(“some data”),
Encoding.UTF8.GetBytes(“some metadata”)
);
// Throws Exception
connection.AppendToStreamAsync(
“test-stream”,
ExpectedVersion.Any,
myEvent
).Wait();
var streamEvents =
connection.ReadStreamEventsForwardAsync("test-stream", 0, 1, false).Result;
var returnedEvent = streamEvents.Events[0].Event;
Console.WriteLine("Read event with data: {0}, metadata: {1}",
Encoding.UTF8.GetString(returnedEvent.Data),
Encoding.UTF8.GetString(returnedEvent.Metadata));
``