摘要:
基本环境:VS2019+EF6,根据https://www.cnblogs.com/lidaying5/p/12756661.html进行多语言设置,添加资源文件,语言切换按钮,添加资源文件键值对Email,PropertyValueRequired等 验证信息实现多语言主要分为两部分: 1.Mod 阅读全文
随笔档案-2020年06月
EF6 动态设置DbContext的连接字符串
2020-06-11 22:49 by 若藜520, 1520 阅读, 收藏, 编辑
摘要:
public class StudentContext : DbContext { public StudentContext() : base(connstr) { } public StudentContext(string studentdb) : base(studentdb) { } pu 阅读全文
转 Code First 数据注释--InverseProperty 和 ForeignKey
2020-06-07 13:59 by 若藜520, 274 阅读, 收藏, 编辑
摘要:
转自https://www.cnblogs.com/goodlucklzq/p/4538500.html ForeignKey 按照约定在Post类中看到BlogId属性,会认为是Blog类的外键,但是在Blog类中并没有BlogId属性,解决方法是,在 Post 中创建一个导航属性,并使用 For 阅读全文