Entity Framework Code-First(3):Setup Environment
2016-07-05 16:03 追忆似水流年 阅读(159) 评论(0) 编辑 收藏 举报Setup Development Environment for EF Code-First:
Let's setup the development environment for Code-First before starting on it.
Install the following tools to work with Entity Framework Code-First:
- .NET Framework 4.5
- Visual Studio 2012
- MS SQL Server 2008/2012 Express
Install EF via Nuget:
Here, we will install Entity Framework API (EntityFramework.dll) via NuGet in the VS 2012 console application. (You can install EF via NuGet the same way in any version of Visual Studio.)
First, create the console application. Right click on your project in the solution explorer and select Manage NuGet Packages..
This will open Manage NuGet Packages dialogue box. Now, select Online in the left bar and search for EntityFramework as shown below.
This will search for all the packages related to Entity Framework. Select EntityFramework and click on Install.
Click on the I Accept button in the License Acceptance dialogue box to start the installation.
After installation, make sure that the appropriate version of EntityFramework.dll is included in the project.
Now, we are ready to use Entity Framework Code-First in our sample console project. Let's start writing our first simple code-first example in the next section.