I've got one solution - the one project is class library with .edmx data model The other is asp.net web forms project.
when i start the solution I get the following exception:
The type 'System.Data.Entity.DbContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
and when I see the references in my asp.net project I see the reference to my class and I can't see reference to entity framework. But the problem is that entity framework is installed both in my class library and web project
A DbSet represents the collection of all entities in the context, or that can be queried from the database, of a given type. DbSet objects are created from a DbContext using the DbContext.
A DbContext instance represents a combination of the Unit Of Work and Repository patterns such that it can be used to query from a database and group together changes that will then be written back to the store as a unit. DbContext is conceptually similar to ObjectContext.
I think your EntityFramework
version was confused
Please download the correct version by using the NuGet
package installer.
See this discussion for getting started: The type or namespace name 'DbContext' could not be found
And look this same problem and Answer : is Here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With