EntityFramework gives IDisposable error

I am using EF for DataLayer backend in my asp.net sites. I am creating a class library and adding a model to it, linking to it and using it from an ASP.NET website. But this time I generated the model from the database, but it doesn't seem to implement IDisposable, and the methods I used don't exist. DeleteObject, SaveChanges, etc. There are only two tables in the DB, and the model was generated with only tablesets and two AddToTableSet methods ... If anyone faced such a problem? alt text http://techlipse.net/EF-problem.jpg

+2


a source to share


2 answers


Have you extended the created ObjectContext and possibly renamed it to EDMX? You can look at your partial class part here without the generated part.

What does the properties panel say for your EDMX for "Entity Container Name"?

When you right click on Entities and go to the definition, you are taken to the correct generated class?



And finally, but it is likely that you could have removed the link to System.Data.Entity

from the project or not link to it in your web project?

Are you a web project even a web application project ???

+4


a source


I have Entity Framework code in a project of its own and referenced from a separate project. NuGet only installs the EntityFramework in the EF project, as this link is automatically set to the latest version. To correct this error: Tools → Package Manager libraries → Package Management solutions for Nuget Select Installed Packages and locate Entity Framework Click "Manage" and check the entire project, which will have access to the EF data model.



+3


a source







All Articles