https://www.cnblogs.com/chenwolong/p/7531955.html
EF使用AsNoTracking(),無跟蹤查詢技術(查詢出來的數據不可以修改,如果你做了修改,你會發現修改並不成功)
using (var context = new DBContext()) { var blogs = context.Student.AsNoTracking().ToList(); //查詢結果是數據庫實體 }
using (var context = new DBContext()) { context.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking; var stu= context.Student.ToList(); }
