Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有区别
var c = context.users.Find(100)
和
var c = context.users.FirstOrDefault(o=>o.id = 100)
我不知道为什么Find方法返回缓存数据。
Find
如果具有指定键的对象已附加到数据上下文,则 Find() 将避免访问数据库。