hawk4031
EF Core and environment variables
Ok cool I got it! I create a new class implementing IDesignTimeDbContextFactory that could read the environment variables and it's able to properly create the design-time DbContext and do what I need it.
Thanks for your help @ded
15 replies
EF Core and environment variables
It looks something like this (I took out the DbSets and entity builder stuff because it's probably not relevant here)
https://gist.github.com/hawk4031/b4366ef32fea0265921d6e88e2beae45
I'm adding the dbcontext in the startup file with
services.AddDbContext()
. I'm also making use of the environment variables there to build up the connection string and set it with UseNpgsql(connectionString)
.15 replies
EF Core and environment variables
Ok so maybe there isn't an issue around the environment variables because I'm still getting the other after even after the addition of that boolean. The error is nice and vague
Unable to create a 'DbContext' of type ''
15 replies