Lazy Loading vs Eager Loading

c# entity-framework entity-framework-6

Accepted Answer

I believe that grouping relationships in this way is beneficial.

using eager loading when

  1. With the principal entity in "one side" of one-to-many relations, which are undoubtedly employed everywhere. like an article's User property. Product's Category attribute.
  2. Generally When there aren't too many relations, eager loading is a smart idea to cut down on server demand.

using slow loading when

  1. the majority of the "collection sides" of one-to-many interactions. like User Articles or Category Products
  2. You are fully aware that you won't need a property right away.

Like Transcendent mentioned, lethargic loading may cause a disposal issue.

68
7/12/2015 9:47:35 AM

Popular Answer

ZZZ_tmp


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow