How to create classes for postgres tables requiring surrounding quotes

I have an existing pgSql database that I have to work with. It requires quoting of everything (table name, columns).

I’ve managed to do a manual select into my model using
db.Select< User >(@“Select * from ““User”””)

However, I cannot get it to work without manual select as it errors with Npgsql.PostgresException : 42P01: relation “user” does not exist.

This is the pgsql for the table

create table "User"
(
	"Id" serial not null
		constraint pk_user_5575058
			primary key,
	"FirstName" varchar(50),
	"LastName" varchar(50),
	"Email" varchar(50) not null,
	"Password" varchar(255) not null,
	"LocationId" integer

)

and here is my model

public class User
{
    public int Id { get; set; }
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public string Email { get; set; }
    public string Password { get; set; }
    public int LocationId { get; set; }
}

Is the issue because it uses an Uppercase “User” instead of “user”? If so you’ll need to change the NamingStrategy maybe reverting it back to:

PostgreSqlDialect.Provider.NamingStrategy = new OrmLiteNamingStrategyBase();

If that doesn’t work you can try creating your own NamingStrategy by inheriting from OrmLiteNamingStrategyBase.

Ok so setting that seems to work with some basic tests. What’s the default strategy used? All lowercase I’m guessing/assuming?

PostgreSqlNamingStrategy