protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
            {
                _resource.CreateDatabaseAsync(typeof(TResult).Name + ++increment)
                .GetAwaiter().GetResult();

                optionsBuilder
                .UseNpgsql(_resource.GetConnection(typeof(TResult).Name + increment))
                .EnableSensitiveDataLogging()
                .UseLoggerFactory(ConsoleLogger);
            }
        private async Task <Func <IResolverContext, IEnumerable <T> > > BuildResolverAsync <T>(
            params T[] results)
            where T : class
        {
            var databaseName = Guid.NewGuid().ToString("N");
            var dbContext    = new DatabaseContext <T>(_resource, databaseName);

            var sql = dbContext.Database.GenerateCreateScript();
            await _resource.CreateDatabaseAsync(databaseName);

            await _resource.RunSqlScriptAsync(
                "CREATE EXTENSION postgis;\n" + sql,
                databaseName);

            dbContext.AddRange(results);
            dbContext.SaveChanges();

            return(ctx => dbContext.Data.AsQueryable());
        }