예제 #1
0
 public virtual RawEvent Serialize(ContextSchemaConfigs configs, UntypedEventEnvelope change)
 {
     return(new RawEvent(
                configs.GetTypeName(change.Body.GetType())
                , change.Id
                , Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(change.Metadata))
                , Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(change.Body))));
 }
        private static UntypedEventEnvelope CreateUntypedEventEnvelope()
        {
            var domainEvent    = new FakeDomainEvent();
            var correlationId  = Guid.NewGuid().ToString();
            var causationId    = Guid.NewGuid().ToString();
            var eventMetadata  = new UntypedEventEnvelope.EventMetadata(correlationId, causationId);
            var envelopedEvent = new UntypedEventEnvelope(domainEvent.EventId, eventMetadata, domainEvent);

            return(envelopedEvent);
        }
예제 #3
0
        private EventData ConvertEventEnvelopeToEventData(UntypedEventEnvelope @event)
        {
            var raw = _serdes.Serialize(@event);

            return(new EventData(
                       raw.EventId,
                       raw.EventType,
                       true,
                       raw.Body,
                       raw.Metadata));
        }
 public RawEvent Serialize(UntypedEventEnvelope change)
 {
     return(_serializationInterpreter.Serialize(_configs, change));
 }