public async Task OpenAsync(AzurePartitionContext context)
            {
                IEventHubPartitionContext partitionContext =
                    new EventHubPartitionContext(context);

                await this.eventProcessor.OpenAsync(partitionContext);
            }
            public IAzureEventProcessor CreateEventProcessor(
                AzurePartitionContext context)
            {
                IEventHubPartitionContext partitionContext =
                    new EventHubPartitionContext(context);

                AzureEventProcessor azureEventProcessor =
                    new AzureEventProcessor(this.eventProcessor);

                return(azureEventProcessor);
            }
            public async Task ProcessErrorAsync(
                AzurePartitionContext context,
                Exception error)
            {
                IEventHubPartitionContext partitionContext =
                    new EventHubPartitionContext(context);

                await this.eventProcessor.ProcessErrorAsync(
                    partitionContext,
                    error);
            }
            public async Task CloseAsync(
                AzurePartitionContext context,
                AzureCloseReason reason)
            {
                IEventHubPartitionContext partitionContext =
                    new EventHubPartitionContext(context);
                EventProcessorCloseReason closeReason =
                    reason.ToEventProcessorCloseReason();

                await this.eventProcessor.CloseAsync(
                    partitionContext,
                    closeReason);
            }
            public async Task ProcessEventsAsync(
                AzurePartitionContext context,
                IEnumerable <AzureEventData> messages)
            {
                IEventHubPartitionContext partitionContext =
                    new EventHubPartitionContext(context);

                IEnumerable <IEventData> eventDatas =
                    messages.Select(
                        azureEventData => new EventData(azureEventData));

                await this.eventProcessor.ProcessEventsAsync(
                    partitionContext,
                    eventDatas);
            }