TotallyJustin
❔ Entity Framework 7 - Where to call EnsureCreared method
I'm trying to create a PGSQL database with a code-first approach using EF7 in my ASP.NET Core Web API application. I have created the models, the ApplicationDbContext and the connection string, and want to know how to call the EnsureCreated method rather than using a migration to an existing database. Previously in .NET 6, it was called in the ConfigurationServices method in the Startup.cs file, but I'm struggling to find how top do the equivalent in Program.cs, which Startup.cs has been integrated into as part of .NET 7. Thanks in advance!
26 replies