The default naming conventions for Entity Framework Core are quite annoying when using PostgreSQL. EF Core generates all databases objects using Pascal Casing, as a consequence you have to add quotes to all queries which exactly ain’t fun if you have to write some queries by hand.
Let’s update the naming convention to use snake_case which is what PostgreSQL expects.
Let’s start by adding a simple ToSnakeCase extension method:
Now it’s time to update our OnModelCreating method and change the naming convention:
That’s it!