摘要: 1, Context生命周期,多种事务 Content实例 能不能整个进程就一个context实例呀? 1,不行content相当占用资源 2,SaveChange 本身是一种事务一次性可以执行多条操纵 那每个数据操作都去来个context实例? 1 内存消耗大,没法缓存 2 多context实例 阅读全文
posted @ 2020-03-31 16:19 YZM_Leo 阅读(224) 评论(0) 推荐(0)
摘要: 1 class Program 2 { 3 static void Main(string[] args) 4 { 5 /* 6 { 7 UserDb db = new UserDb(); 8 var usersone = db.Users.FirstOrDefault(x => x.Id == 1 阅读全文
posted @ 2020-03-31 10:05 YZM_Leo 阅读(283) 评论(0) 推荐(0)