1.创建一个空项目 2.在项目中创建EFCore的类库 3.在NuGut控制台为EFCore项目中安装entity 3.1 命令为:Install-Package EntityFramework(在EFCore项目中进行) 4.创建实体类Students using System; using System.ComponentModel.DataAnnotations; namespace EFCore { public class Students { /// <summary> ///…
这次的Demo如标题所示, 首先第一步EF创建数据库 创建两个类,一个是图书类,一个是图书类别的类 using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Web; namespace WebApplication2.DAL { public class Book { [Key] public int B…
最近悟出来一个道理,在这儿分享给大家:学历代表你的过去,能力代表你的现在,学习代表你的将来. 十年河东十年河西,莫欺少年穷 学无止境,精益求精 话说EF支持三种模式:Code First Model First DataBase First,微软最新的EF框架,也就是EF7舍弃了Model First 和 DataBase First,咱们作为最底层的程序员必须跟着'党'的走,既然微软都放弃了Model First 和 Database First,那么我们也应当跟着'党'的路线走…