Code First Migration with Connection Strings

前端 未结 2 1241
盖世英雄少女心
盖世英雄少女心 2020-12-13 17:53

So I\'ve managed to get Code First running and it works great.

Since I am still developing the application the structure of the Database isn\'t finalize and so I ne

2条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-13 18:11

    Why does Entity Framework's EF Migrations Add-Migration step require a database connection string?

    Has a solution which i consider less labor intensive in the long run. As if you create a connection string with the same name

    On your context :base("DBName")

    Connection string name and initial catalog match the DBName you specified and you don't need to enter the connection string name every time.

提交回复
热议问题