Beispiel #1
0
        public IEvent Deserialize(ResolvedEvent resolvedEvent)
        {
            var jsonMetadata = Encoding.ASCII.GetString(resolvedEvent.Event.Metadata);
            var metadata     = EventMetadata.FromJson(jsonMetadata);

            var eventData    = Encoding.ASCII.GetString(resolvedEvent.Event.Data);
            var deserialized = (IEvent)JsonConvert.DeserializeObject(eventData, metadata.EventType);

            return(deserialized);
        }