Ejemplo n.º 1
0
        public GetEventStoreSubscription(
            IEventStoreConnection connection,
            IEventSubscriber subscriber,
            ProjectionClient projectionClient,
            string prefix,
            string position,
            string streamFilter)
        {
            Guard.NotNull(subscriber, nameof(subscriber));

            this.connection = connection;
            this.position   = projectionClient.ParsePositionOrNull(position);
            this.subscriber = subscriber;

            var streamName = projectionClient.CreateProjectionAsync(streamFilter).Result;

            subscription = SubscribeToStream(streamName);
        }
        public GetEventStoreSubscription(
            IEventStoreConnection connection,
            IEventSubscriber subscriber,
            IJsonSerializer serializer,
            ProjectionClient projectionClient,
            string?position,
            string?prefix,
            string?streamFilter)
        {
            this.connection = connection;

            this.position = projectionClient.ParsePositionOrNull(position);
            this.prefix   = prefix;

            var streamName = projectionClient.CreateProjectionAsync(streamFilter).Result;

            this.serializer = serializer;
            this.subscriber = subscriber;

            subscription = SubscribeToStream(streamName);
        }