Reputation: 4451
I'm working on my first project, using Entity Framework. I've got a SQL Express database, based upon some SQL Server 2005 databases. I've generated the model from the database, and EF made several complaints, all of which made sense to me (how in heck did we get away with writing so many tables that don't have any primary key???) So, I've made changes to the SQL Express database schema, and did a right-click in the EF designer and told it to update the design. It did, but I found I still needed to do some work, like delete some tables from the designer the EF left there, even though I had dropped them from the SQL Express database. But there are other things wrong, like the additional columns EF added to what it thought should comprise the primary keys for all of those tables that didn't have any primary key.
So, what I want to know is, should I just delete the .edmx file and start over again, or not?
Upvotes: 1
Views: 2632
Reputation: 37440
I find that the update does not work very well when adding or removing tables.
Early on in a project, when the schema is undergoing frequent revisions, I find it's best to delete and re-create the EDMX file.
So yes, just delete it and recreate it.
Upvotes: 2