0
votes
  1. I have installed Visual Studio 2012 Express for Web, licensed it

  2. Created new Basic MVC 4 web application. It's a simple bookstore website example

  3. Added connection to SQL Server Express 2008 database. There are already 3 linked tables in it

  4. Created a new model for Books table

  5. As you see on the screenshot, I tried to add a data context exactly like it is in all tutorials but for some reason it doesn't recognize DBContext class. Nowhere is said to create this class manually so I assume it should be in System.Data.Entity...

Why doesn't it recognize that class?

enter image description here

1
Have you added a reference to Entity Framework? nuget.org/packages/EntityFrameworkSteve Greene
Not sure if it makes difference but try DbContext not DBContextJames P

1 Answers

1
votes

You need to use DbContext not 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.

See here for reference.