public bool ProcessPartitionCreated(string partition, CheckpointTag createPosition, ResolvedEvent @event,
                                            out EmittedEventEnvelope[] emittedEvents)
        {
            CheckDisposed();
            _eventPosition = createPosition;
            _emittedEvents = null;

            var data = GetEventData(@event);

            if (@event == null || data == null || string.IsNullOrEmpty(@event.EventType))
            {
                emittedEvents = null;
                return(true);
            }

            _query.NotifyCreated(
                data,
                new[] {
                @event.IsJson ? "1" : "", @event.EventStreamId, @event.EventType, "",
                @event.EventSequenceNumber.ToString(CultureInfo.InvariantCulture), @event.Metadata ?? "",
                @event.PositionMetadata ?? "", partition, ""
            });
            emittedEvents = _emittedEvents == null ? null : _emittedEvents.ToArray();
            return(true);
        }
 public bool ProcessPartitionCreated(string partition, CheckpointTag createPosition, ResolvedEvent data, out EmittedEventEnvelope[] emittedEvents)
 {
     CheckDisposed();
     _eventPosition = createPosition;
     _emittedEvents = null;
     /*var newStates = */ _query.NotifyCreated(
         data.Data.Trim(), // trimming data passed to a JS
         new[]
     {
         data.IsJson ? "1" : "", data.EventStreamId, data.EventType, "",
         data.EventSequenceNumber.ToString(CultureInfo.InvariantCulture), data.Metadata ?? "",
         data.PositionMetadata ?? "", partition, ""
     });
     emittedEvents = _emittedEvents == null ? null : _emittedEvents.ToArray();
     return(true);
 }