References for DBContext, DBSet<> in Entity Framework

manu picture manu · Feb 4, 2011 · Viewed 58.9k times · Source

I am trying to use ADO.Net Codefirst feature of latest Entity Framework 4.0. As part of that I have installed Entity Framework CTP 4 from Microsft and using Scott's tutorial to create the model first. Inside the tutorial DBContext and DBSet<> is specified. Could some tell what is the reference to be used in order to access this class.

I have used the following references however nothing happens for DBContext and DBSet<>

  • System.Data.Entity
  • System.Data.Entity.Design

Answer

Feckmore picture Feckmore · Apr 3, 2011

You can use the Library Package Manager if you have it (it installs automatically with MVC 3.0).

From within your project in Visual Studio 2010, go to

Tools > Library Package Manager > Package Manager Console

From within your project in Visual Studio 2013, go to

Tools > NuGet Package Manager > Package Manager Console

In the console, after the PM> prompt, type

install-package entityframework

This will install the package and add the EntityFramework reference to your project.