EF ObjectContext.SaveChanges is missing

I am working with Entity Framework in a new project. I use EF a year ago. Today I tried to generate an entity data model using Visual Studio (2008 SP1 and 2010), and it generates the context properties of the object and entity, but did not generate the SaveChanges method. I even tried to use the databases that I used earlier to create entity data models. I do not know what's happening. I used my laptop and desktop, but did not work on both, even when I did this before in both.

My enviroment:

Visual Studio 2008 SP1. SQL Server 2008 Express Factory Web Access Software February 2008

+7
entity-framework savechanges
source share
3 answers

It may be late, but you need to include the System.Data.Entity namespace to get this extension method.

+14
source share

Inherit your context from DbContext, as the public class MYContext: DbContext

+1
source share

For more recent people coming here for an answer, you may also need the NuGet Entity Framework 5.0 (or later) in your project.
The colleague I just helped with had this problem when he used EF 5 in a separate project for EDMX, but for a project in which he used objects, he did not capture the EF 5 structure. Even when using System.Entity.Framework and all of the other LINQ, Entity, and XML assemblies that he was trying to add, it still doesn't work. I suggested restarting VS2012, and then a few handy bugs came up regarding the EF 5 Framework.

+1
source share

All Articles