Hi guys, I want to start using the event store, but have some issues with it.
Here is the method that persists the event:
private void AppendEvent(Guid id, string type, byte[] data, byte[] metadata)
{
var stream = GetStreamName(id, type);
CreateStream(id, type, metadata);
var evnt = new Event(id, type, data, metadata);
var evnts = new List<Event>();
evnts.Add(evnt);
EventStore.ClientAPI.EventStore.AppendToStream(stream, 0, evnts);
}
``
Here is the method that reads the persisted events:
public IList<EventEnvelope> ReadEvents(Guid id, string type, int fromVersion, int toVersion)
{
var stream = GetStreamName(id, type);
var slice = EventStore.ClientAPI.EventStore.ReadEventStream(stream, fromVersion, toVersion);
IList<Event> tmp =
slice.Events.Select(
recordedEvent =>
new Event(recordedEvent.EventId, recordedEvent.EventType, recordedEvent.Data, recordedEvent.Metadata))
.ToList();
return tmp.Select(e => DeserializeEventEnvelope(e.Data)).ToList();
}
``
The event is read but the Data field is empty. At serialization time the Data field is not empty, so something happens in the event store and I am not getting the same thing I put in it. This happens on the master branch.