Reputation: 35380
I made some changes to my database and then clicked "Update Model from Database..." command. Apparently it worked and my model was updated. But EF is no longer generating POCO and context classes for my entities, resulting in around 200 errors across the project. Common tricks like closing and reopening the model or restarting VS didn't prove any good. Is this a bug or something? Any workarounds?
I have been using this Update functionality for a while without any issues. This VS2013 Express for Web with EF6 and SQL Server 2008 R2 Express as the database server.
Upvotes: 0
Views: 367
Reputation: 35380
Figured out. The problem was that I had changed a nullable FK in one table to non-nullable. EF6 for some reason didn't update that association from (0..1 - *) to (1 - *). I opened EDMX and changed that association manually (by setting End1 Multiplicity to 1). Save and recompiled and everything is fine now. Hope this helps someone down the road.
Upvotes: 3