0
votes

I've created my objects in ASP.NET MVC4, and after running the application, only UserProfile table is auto created, not the other one corresponding my class.

Followed this advice: Entity Framework 4.1 Code First not creating tables and got this error:

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.

Question 1: What is the correct way to do this in Code First approach?

Question 2: Why is the built-in UserProfile created, and not the table for my object? What makes the difference?

1
Can you provide your other class? Are you having proper data annotations? - bdoshi
can you post your context? - SOfanatic

1 Answers

1
votes

Please read my answer here ... same situation I think. UserProfile table created, others not created. My guess is that you've switched to an actual MSSQL DB and not a local DB, but have not pointed your WebSecurity DB initialization to the new database.