Coding

How to create dynamic environment sequencing columns in .Net Core EF migrations with PostgreSQL / Npgsql

Recently I’ve been building out a .Net Core WebAPI microservice that talks to a PostgreSQL database. We’re diving into the world of HATEOS so we want to have a Url parameter that correlates to the Id of the record once it is created. Additionally, we’re using Docker to better manage our deployments, so we want to be able to have this URL change when building the database in each environment as part of our Entity Framework migrations process.

It’s a bit tricky, but doable. Here’s how you get your “ducks in a row” in order to make this happen.

Continue reading “How to create dynamic environment sequencing columns in .Net Core EF migrations with PostgreSQL / Npgsql”