Lazy loading, Deferred Loading and Eager Loading in Entity framework

前端 未结 3 1651
抹茶落季
抹茶落季 2020-12-09 20:33

What are the differences between these 3 types of loading? Can someone explain with an example? Different resources online use different definitions causing more confusion t

3条回答
  •  春和景丽
    2020-12-09 21:03

    Lazy/Deferred Loading: Lazy loading and Deferred Loading are same thing. The relationship is loaded when it is accessed for the first time. The idea is that if the data is not required it should not be loaded.

    Eager Loading: Relationship is fetched along with the Parent object. This can be more efficient in loading data but will load data irrespective of the data being used/notused.

提交回复
热议问题