How to specify database name in Code First?

后端 未结 7 1331
广开言路
广开言路 2020-12-13 06:00

How do I tell EF what to name the database and where to put it?

If there is no connection string in the Web.Config, it tries to put it in the local SQLEXPRESS Server

7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-13 06:22

    Create a connection string in the app.config/web.config with the same name as the context and the EF will use that DB.

提交回复
热议问题