I have a .net Core 3.1 Web API solution, using EF Core for the database. When I execute Add-Migration
to generate database migrations, the tool runs the startup project. I want to skip some code that executes when the startup project starts (it will not impact the migration generation). Is there a way to tell, in the project code, that it has been launched from the EF tool?
How to detect when project is run by Add-Migration
456 Views Asked by Andrew At
2
In Entity Framework Core 7, they've added the static flag EF.InDesignTime that you can check to know if you are in design time: