摘要: //全部更新 public T Update<T>(T entity) where T : ModelBase { var set = this.Set<T>(); set.Attach(entity); this.Entry<T>(entity).State = EntityState.Modif 阅读全文
posted @ 2020-11-06 11:00 delafqm 阅读(410) 评论(0) 推荐(0) 编辑
摘要: public class A { public int Id {get;set;} //数字型,主键,相关自增ID号 public string aStr{get;set;} //字符型主键,唯一性 public B b {get;set;} //A对B,一对一 } public class B { 阅读全文
posted @ 2020-11-06 10:57 delafqm 阅读(297) 评论(0) 推荐(1) 编辑
摘要: 执行SQL语句返回数据 Context.TableName.FromSql(""); 已过时 Context.TableName.FromSqlRaw("") 能用 Context.TableName.FromSqlInterpolated(""); 能用 阅读全文
posted @ 2020-11-06 10:32 delafqm 阅读(117) 评论(0) 推荐(0) 编辑