安装Entity Framework【Setup Entity Framework Environment】(EF基础种类篇4)

Entity Framework 5.0 API是遍布在五个地点:NuGet和.NET Framework中,这么些.NET framework 4.0/4.5饱含EF主题的API,可是透过NuGet包拿走的EntityFramework.dll包罗EF 5.0越发的特色;EF6.0中不是分其他:

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.

图片 1

图片 2

 

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:

  • .NET Framework
    4.5
  • Visual Studio
    2012
  • MS SQL Server
    2005/2008/2012 Express

一对多:Standard and Teacher表之间是一对多的关联,例如很多Teacher关联八个Standard;

设置到位之后,是如此的:然后倒闭这几个窗口就行了。。。

图片 3

 

然后,我们选中“项目名称”,点击右键,采取“管理Nuget程序包”,在弹出来的界面中,输入:”EntityFramework”,会自行查询到EntityFramework,然后点击安装,根据本身上边包车型地铁图示举办就能够了:

图片 4

图片 5

图片 6

在那些数据图表中,大家得以看看,差别表之间的涉及:

MS SQL Server2005/2008/2012/2014 Express

Visual Studio 2012/2013/2015

上面大家来看看怎么安装EF吧:

创立数据库:

那一个体系课程中,小编将会接纳SchoolDB样例数据库,它包括数据表,存款和储蓄进度,和视图;数据库的规划如下:

图片 7

 

You can see in the above
diagram that the sample SchoolDB database includes tables with the
following relationships, for demo purpose.

  • One-to-One: Student and
    StudentAddress have a one-to-one relationship eg. Student has zero
    or one StudentAddress.
  • One-to-Many: Standard
    and Teacher have a one-to-many relationship eg. many Teachers can be
    associate with one Standard.
  • Many-to-Many: Student
    and Course have a many-to-many relationship using StudentCourse
    table where StudentCourse table includes StudentId and CourseId. So
    one student can join many courses and one course also can have many
    students.

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.

 

.NET Framework 4.5

好了,EF的安装就到此,相信我们早就学会了,后边一节自作者快要学习一个粗略的实业数据模型来创造数据库。

 

多对多:Student and Course表之间是多对多关系,通过中间表StudentCourse 联系在一道,例如;一个学生能够选拔过多科目,同时1个课程能够有许多上学的儿童来摘取;

 

在那一个基础的触目皆是课程中,我将会使用EF 6.0,这么些最新的EF版本来学习,

咱俩开辟VS二〇一三新建项目:

图片 8

一定:Student and StudentAddress表之间是分外的涉及,例如2个Student有0到3个的StudentAddress;

学学EF,首先要安装上面包车型大巴工具:

相关文章