Install Entity Framework (EF basics Series 4), entityef
Entity Framework 5.0 APIs are distributed in two places: NuGet and. NET Framework, this. NET framework 4.0/4.5 contains the core API of EF, but the EntityFramework obtained through the NuGet package. dll contains special features of EF 5.0; EF6.0 is not separated:
In this basic series of courses, I will use EF 6.0, the latest EF version to learn EF. First install the following tool :. NET Framework 4.5 Visual Studio 2012/2013/2015 ms SQL Server2005/2008/2012/2014 Express let's see how to install EF: Open VS2012 to create a project:
Then, select "project name", right-click, and select "manage Nuget packages". On the displayed page, enter "EntityFramework". The EntityFramework is automatically queried, click "Install" and follow the instructions below to install the SDK:
After the installation is complete, close the window...
Create a database:
In this series of courses, I will use the SchoolDB sample database, which contains data tables, stored procedures, and views. The database is designed as follows:
In this data chart, we can see the relationship between different tables: one-to-one: Student and StudentAddress, for example, a Student has 0 to 1 StudentAddress; one-to-many: Standard and Teacher tables have one-to-many relationships. For example, many Teacher tables are associated with a Standard table; multiple-to-many: student and Course tables have many-to-many relationships. StudentCourse tables are associated with each other through the intermediate table. For example, a Student can select many courses and a Course can have many students to choose from;
Now we have installed EF, and I believe you have learned it. In the next section, I will learn a simple Entity Data Model to create a database.