摘要: 1.创建Models实体类 //切记分清主外键 切记引用命名空间 2.创建Dal文件夹,新建codefirst1,开始完成迁移 3.开始编写代码 在DAL文件夹里新建类 //ToList 只要.ToList 就必须查询数据库 //select * from studetn where 1=1 //I 阅读全文
posted @ 2021-07-15 21:17 天澈明香 阅读(36) 评论(0) 推荐(0)
摘要: 一、新建Models 中实体类 ​ 在类中添加特性,添加特性之前需要引用命名空间using System.ComponentModel.DataAnnotations;using System.ComponentModel.DataAnnotations.Schema; [Table("Studen 阅读全文
posted @ 2021-07-15 21:04 天澈明香 阅读(34) 评论(0) 推荐(0)