标签:
Entity Framework 5.0 API was distributed in two places, in NuGet package and in .NET framework. The .NET framework 4.0/4.5 included EF core API, whereas EntityFramework.dll via NuGet package included EF 5.0 specific features.
This has been changed with EF 6.0 which is included in EntityFramework.dll only and is not dependent on .NET framework.
For the basic tutorials, we will use EF 6.0, the latest version of entity framework as of this writing.
Install the following tools to work with entity framework:
You can install entity framework into your project via nuget. Here, we will install EF (EntityFramework.dll) via nuget in the console application in VS 2012. You can install EF via NuGet the same way in any version of Visual Studio.
Right click on project in the solution explorer and select Manage NuGet Packages..
This will open Manage NuGet packages dialogue box. Now, select Online in 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 License Acceptance dialogue box. This will start the installation.
After installation, make sure that the appropriate version of EntityFramework.dll is included in the project.
Now, you are ready to use Entity Framework in your project.
This tutorial will use sample SchoolDB which has different tables, stored procedures and views. The SchoolDB database design is shown below:
You can see in the above diagram that the sample SchoolDB database includes tables with the following relationships, for demo purpose.
Download Sample Project for all the tutorials on entity framework.
Let‘s create first simple Entity Data Model for sample School database in the next section.
Entity Framework Tutorial Basics(4):Setup Entity Framework Environment
标签:
原文地址:http://www.cnblogs.com/purplefox2008/p/5648769.html