public async Task use_projection_with_custom_projectionKey_name()
        {
            _testHelper.LoadTwoProjectsWithOneEventEach();

            var projection = new ProjectionWithCustomProjectionKeyName();

            StoreOptions(_ =>
            {
                _.Events.AddEventType(typeof(ProjectStarted));
                _.Events.AsyncProjections.Add(projection);
                _.Events.DatabaseSchemaName = "events";
            });

            theStore.Schema.ApplyAllConfiguredChangesToDatabase();

            _testHelper.PublishAllProjectEvents(theStore, false);

            using (var daemon = theStore.BuildProjectionDaemon(
                       logger: _logger,
                       viewTypes: new[] { typeof(ProjectionWithCustomProjectionKeyName) },
                       settings: new DaemonSettings
            {
                LeadingEdgeBuffer = 0.Seconds()
            }))
            {
                await daemon.Rebuild <ProjectionWithCustomProjectionKeyName>();
            }

            projection.Observed.Count.ShouldBe(2);
            using (var conn = theStore.Tenancy.Default.OpenConnection())
            {
                var command = conn.Connection.CreateCommand();

                command.Sql($"select last_seq_id from {theStore.Events.DatabaseSchemaName}.mt_event_progression where name = :name")
                .With("name", projection.GetEventProgressionName());

                using (var reader = await command.ExecuteReaderAsync().ConfigureAwait(false))
                {
                    var any = await reader.ReadAsync().ConfigureAwait(false);

                    if (!any)
                    {
                        throw new Exception("No projection found");
                    }

                    var lastEncountered = await reader.GetFieldValueAsync <long>(0);

                    lastEncountered.ShouldBe(2);
                }
            }
        }
        public async Task custom_projection_with_customKeyName_can_fetch_current_state()
        {
            _testHelper.LoadTwoProjectsWithOneEventEach();

            var projection = new ProjectionWithCustomProjectionKeyName();

            StoreOptions(_ =>
            {
                _.Events.AddEventType(typeof(ProjectStarted));
                _.Events.AsyncProjections.Add(projection);
                _.Events.DatabaseSchemaName = "events";
            });

            theStore.Schema.ApplyAllConfiguredChangesToDatabase();

            _testHelper.PublishAllProjectEvents(theStore, false);

            using (var conn = theStore.Tenancy.Default.OpenConnection())
            {
                var command = conn.Connection.CreateCommand();

                command.Sql($"insert into {theStore.Events.DatabaseSchemaName}.mt_event_progression (last_seq_id, name) values (:seq, :name)")
                .With("seq", 1)
                .With("name", projection.GetEventProgressionName())
                ;

                await command.ExecuteNonQueryAsync().ConfigureAwait(false);
            }

            using (var daemon = theStore.BuildProjectionDaemon(
                       logger: _logger,
                       viewTypes: new[] { typeof(ProjectionWithCustomProjectionKeyName) },
                       settings: new DaemonSettings
            {
                LeadingEdgeBuffer = 0.Seconds()
            }))
            {
                daemon.Start <ProjectionWithCustomProjectionKeyName>(DaemonLifecycle.StopAtEndOfEventData);
                await daemon.WaitForNonStaleResultsOf <ProjectionWithCustomProjectionKeyName>();
            }

            projection.Observed.ShouldHaveSingleItem().ShouldBe(2);
        }