Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the purpose of StartupProjectName parameter in Add-Migration in EF

As I understand what Add-Migration is doing, it's just compares the current model of code with the model of last applied migration (which has the entire model in its resx file)

For the description of StartupProjectName paramter it says:

-StartUpProjectName

Specifies the configuration file to use for named connection strings. If omitted, the specified project’s configuration file is used.

If each migration has a snapshot of whole model, then there would no need to have a database, since the current model and that snapshot are totally comparable.

So why is this parameter provided in Add-Migration command to specify a connection string?

like image 445
mehrandvd Avatar asked Sep 14 '25 22:09

mehrandvd


1 Answers

With that parameter you can specify the project which contains your connection string (in app.config e.g.).

You can have your migrations in a seperate project (which doesn't contain the connection string).

like image 153
ronaldm Avatar answered Sep 17 '25 11:09

ronaldm