public Stream(string streamId, EventMessage[] committedEvents)
 {
     UncommittedHeaders = new Dictionary<string, object>();
     UncommittedEvents = new List<EventMessage>();
     StreamId = streamId;
     CommittedEvents = committedEvents;
 }
        public ClientAPI.IEvent Serialize(EventMessage source)
        {
            var my = source.Body as IEvent;

            string json = JsonConvert.SerializeObject(source.Body);
            var bytes = Encoding.UTF8.GetBytes(json);
            return new InnerEvent
            {
                EventId = my.Id,
                Type = source.Body.GetType().FullName,
                Data = bytes
            };
        }
 public void Add(EventMessage uncommittedEvent)
 {
     UncommittedEvents.Add(uncommittedEvent);
 }