您的位置:首页 > 其它

Using NuGet to Install EFCodeFirst

2011-02-05 22:50 351 查看
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.

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: