通过Nuget安装Entity Framework, 创建model;[Table("")] 代表在数据库对应的名称,可以自定义规则,[Key]代表是主键 [Table("Portal.News")] public class Portal_News : BaseModel { [Key] public string ID { get; set; } public string Title { get; set; } } 创建EF上下文文件DBCommon,并继承D…
什么也不说先贴代码 <?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> <section…