Entity Framework 5, switch from code first to database first?

旧城冷巷雨未停 提交于 2019-12-03 03:44:12

This should be easy, just create a new, database first model and delete your code first model. Most of your code will compile just fine if you are in the same namespace and take care of naming your context in the same way.

Switching to database first however, makes you lose the ability to migrate which is a solid advantage of the code first approach. If I were you, I would spend more time on trying to create a migration, even write one manually if the generator fails but still stick with the code first.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!