private Task <IEventHubReceiver> EHGeneratorReceiverFactory(EventHubPartitionSettings settings, string offset, Logger logger, ITelemetryProducer telemetryProducer)
            {
                var generator         = new EventHubPartitionDataGenerator(logger, this.serviceProvider.GetRequiredService <SerializationManager>(), this.ehGeneratorSettings);
                var generatorReceiver = new EventHubPartitionGeneratorReceiver(generator);

                return(Task.FromResult <IEventHubReceiver>(generatorReceiver));
            }
        private Task <IEventHubReceiver> EHGeneratorReceiverFactory(EventHubPartitionSettings settings, string offset, ILogger logger, ITelemetryProducer telemetryProducer)
        {
            Func <IStreamIdentity, IStreamDataGenerator <EventData> > streamGeneratorFactory = this.serviceProvider.GetServiceByName <Func <IStreamIdentity, IStreamDataGenerator <EventData> > >(this.Name)
                                                                                               ?? SimpleStreamEventDataGenerator.CreateFactory(this.serviceProvider);
            var generator         = new EventHubPartitionDataGenerator(this.ehGeneratorOptions, streamGeneratorFactory, logger);
            var generatorReceiver = new EventHubPartitionGeneratorReceiver(generator);

            return(Task.FromResult <IEventHubReceiver>(generatorReceiver));
        }