How to Rename DBContext in Entity Framework 6

c# entity-framework-6 visual-studio-2012

Question

I had an issue with EF not pulling in the Foreign Key relationships when doing an Update Model From Database. So I just deleted the .edmx file and regenerated it. The problem is that my context type was named InventoryMgmtContext, and now I am getting the error

The type of namespace InventoryMgmtContext could not be found.

Where/how can you rename the context?

1
11
3/23/2015 2:50:56 AM

Accepted Answer

  1. Open the EDMX diagram, right click the background, and click "Properties":

enter image description here

  1. Change the Entity Container Name value to the name you want:

enter image description here

  1. Save the EDMX.
28
10/5/2016 7:28:44 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow