Change Entity framework database schema at runtime

前端 未结 8 2591
花落未央
花落未央 2021-02-20 13:02

In most asp.net applications you can change the database store by modifing the connectionstring at runtime. i.e I can change from using a test database to a production database

8条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-20 13:36

    Solved my problem by moving to sql server and away from mysql.

    Mysql and Mssql interpret "schemas" differently. Schemas in mysql are the same/synonyms to databases. When I created the model the schema name..which is the same as the database name is hard coded in the generated model xml. In Mssql the schema is by default "dbo" which gets hard coded but this isnt an issue since in mssql schemas and databases are different.

提交回复
热议问题