public static DocumentDbStorageEvent FromStorageEvent(StorageEvent @event, ISerializationTypeMap typeMap)
        {
            var docDbEvent = new DocumentDbStorageEvent();

            docDbEvent.Id       = $"{@event.StreamId}:{@event.EventNumber}";
            docDbEvent.EventId  = @event.EventId;
            docDbEvent.Body     = JObject.FromObject(@event.EventBody);
            docDbEvent.BodyType = typeMap.GetNameFromType(@event.EventBody.GetType());
            if (@event.Metadata != null)
            {
                docDbEvent.Metadata     = JObject.FromObject(@event.Metadata);
                docDbEvent.MetadataType = typeMap.GetNameFromType(@event.Metadata.GetType());
            }
            docDbEvent.StreamId    = @event.StreamId;
            docDbEvent.EventNumber = @event.EventNumber;

            return(docDbEvent);
        }
        public static DocumentDbStorageEvent FromStorageEvent(StorageEvent @event, ISerializationTypeMap typeMap, int?documentTimeToLiveSeconds)
        {
            var docDbEvent = new DocumentDbStorageEvent
            {
                Id                = $"{@event.StreamId}:{@event.EventNumber}",
                EventId           = @event.EventId,
                Body              = JObject.FromObject(@event.EventBody),
                BodyType          = typeMap.GetNameFromType(@event.EventBody.GetType()),
                TimeToLiveSeconds = documentTimeToLiveSeconds
            };

            if (@event.Metadata != null)
            {
                docDbEvent.Metadata     = JObject.FromObject(@event.Metadata);
                docDbEvent.MetadataType = typeMap.GetNameFromType(@event.Metadata.GetType());
            }
            docDbEvent.StreamId    = @event.StreamId;
            docDbEvent.EventNumber = @event.EventNumber;

            return(docDbEvent);
        }