Question

I am working with Entity Framework on a new Project. I've been using EF since a year ago. Today i've tried to generate Entity Data Model with Visual Studio (2008 SP1 and 2010) and it is generating object context properties and entitysets but has not generated SaveChanges method. I've even tried with databases that i've used previosuly to generate entity data models. I don't know what's happening. I used my laptop and my desktop but is not working on both even when i've done it before in both.

My Enviroment is:

Visual Studio 2008 SP1. SQL Server 2008 Express. Web Client Software Factory Feb 2008 Release.

Was it helpful?

Solution

Probably late, but you need to include System.Data.Entity namespace to get this extension method.

OTHER TIPS

Inherit your context from DbContext like public class MYContext : DbContext

For more recent people coming here for an answer, you may also need to NuGet the Entity Framework 5.0 (or later) into your project.
A colleague I was just helping had this issue where he used EF 5 in a separate project for the EDMX, but for the project in which he was using the entities, he didn't grab the EF 5 framework. Even with System.Entity.Framework added, and all the other LINQ, Entity, and XML assemblies he tried adding, it still didn't work. I suggested he restart VS2012, and then a few handy errors suddenly showed up regarding the EF 5 Framework.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top