我已经在ASP.NET MVC4中创建了我的对象,并且在运行应用程序之后,只会自动创建UserProfile表,而不是另一个对应我的类。实体框架“Code First”不创建数据库表
遵循了这一忠告:Entity Framework 4.1 Code First not creating tables和得到这个错误:
Model compatibility cannot be checked because the database does not contain model metadata. Model compatibility can only be checked for databases created using Code First or Code First Migrations.
问题1:什么是代码优先的方法来做到这一点的正确方法是什么?
问题2:为什么创建了内置的UserProfile,而不是我的对象的表?什么改变了?
你能否提供你的其他课程?你有适当的数据注释吗? – bdoshi
你可以发布你的上下文吗? – SOfanatic