rexxiang 最近的时间轴更新
rexxiang

rexxiang

V2EX 第 108304 号会员,加入于 2015-03-31 09:24:41 +08:00
rexxiang 最近回复了
@Dic4000 需不需要延迟加载,是取决于你的需求。错误的使用延迟加载,可能会导致严重的性能问题(N+1 问题)。

LazyLoadingEnabled 为 true 时:标记为 virtual 的子实体 /集合会在第一次使用的时候从 DB 加载出来。
LazyLoadingEnabled 为 false 时,意思就是说,你 EF 不要给我延迟加载了,具体加载哪些子对象 /集合,我只会用 Include 的方式告诉你,没有指定的,你都别管。
必须显式的 include ,不然,有可能 load 一个对象都有可能把整个 db 都 load 出来么。。。
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3963 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 13ms · UTC 05:14 · PVG 13:14 · LAX 22:14 · JFK 01:14
Developed with CodeLauncher
♥ Do have faith in what you're doing.