MVC EDMX Codebehind is using ObjectContext vs DBContext
asp.net-mvc, entity-framework
Solution
You must apply the EF 4.x DbContext Generator to your EDMX model in Visual Studio. You can install the generator template from the Visual Studio extension manager.
When you have installed the template follow the steps under point 4 in this post:
http://blogs.msdn.com/b/adonet/archive/2011/03/15/ef-4-1-model-amp-database-first-walkthrough.aspx
(Replace "ADO.NET DbContext Generator" in the post by the installed "EF 4.x DbContext Generator" which is the up-to-date and renamed version for EF 4.3.1)
The template will generate POCO classes and a derived `DbContext` from your EDMX model.
Problem
I am new to EF. I have a separate Project for my Models. I have EF 4.3.1.0 installed. I see that the base class of the Context is ObjectContext and not DbContext. This becomes an issue when i scaffold my Controller in my front end project where in the Edit action it makes a call to ``` context.Entry(status).State = EntityState.Modified; ``` but Entry is not known. I found that Entry is new with DbContext. How do I have the generated code generate the right stuff? This is a DB First project