Asp.Net core 2.0: Detect Startup class invoked from migration or other ef operation

Viewed 1982

At the current moment all default Startup.cs flow executed on every db related operation like droping db, adding migration, updating db to migrations, etc.

I have heavy app specific code in Startup which need to be invoked only if application run for real. So how could I detect that Startup class run from migration or other database related dotnet command.

2 Answers
Related