We'll start by using the NuGet package manager (automatically installed by ASP.NET MVC 3) to add the EFCodeFirst library to the MvcMovie
project. This library lets us use the code-first approach.
Warning: You must stop debugging before you access the NuGet package manager. If you access NuGet while you are still debugging, you'll get the error message and the Add Library Package Reference... menu item will disappear. You must then exit Visual Web Developer and restart the project.
From the Tools menu, select Library Package Manager and then Add Library Package Reference.
The Add Library Package Reference dialog box appears.
By default, All is selected in the left pane. Because no packages are installed, the center pane shows No items found. Click Online in the left pane.
NuGet queries the server for all available packages.
There are hundreds of packages available. We're interested in the EFCodeFirst package. In the search box, enter "EFCode". In the search results, select the EFCodeFirst package and click the Install button.
After the package installs, click Close. The installation process downloaded the EFCodeFirst library and added it to the MvcMovie
project. The EFCodeFirst library is contained in the EntityFramework assembly.