LINQPad, LLBLGENPro and Npgsql

If you want to test LLBLGenPro/Npgsql queries with LINQPad, and you really should, you have to follow these steps.

  1. Install the official LLBLGenPro driver for LINQPad (Add connection, View more drivers..., ...)
  2. Reference LLBLGenPro generated assemblies (connection configuration), enter proper connection strings and, albeit optional, provide a .config file that contains DBProviderFactiories entry for Npgsql (watch out for version number)
  3. Once connection is created, add Npgsql NuGet package to query. The version should match the one configured in step #2.

And voila, beautiful interactive queries at your disposal. You can even use ORM Profiler.

Sample Npgsql factory entry:

....
<system.data>
    <DbProviderFactories>
      <!-- PostgreSql -->
      <add name="PostgreSql Client Data Provider" invariant="Npgsql" description=".Net Framework Data Provider for PostgreSql" type="Npgsql.NpgsqlFactory, Npgsql, Version=3.1.6.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7" />
    </DbProviderFactories>
  </system.data>

A solution to Visual Studio Tools for Docker debugging problem

I you have problems with debugging your .net core application using Visual Studio Tools for Docker - the app simply stops at start and you see a lot of Trying to connect to http://localhost (N/120) messages (where N = [1,120]) - then you might be interested in the workaround.
Which, as it turns out, is quite simple.
Open docker-compose.debug.yml file and simply remove the volumes section:
    volumes:
      - .:/app

Then you can debug it normally.

See the original solution post named Trying to connect to http://localhost/ (1/XXX) in Q and A section.