Does linq to sql automatically lazy load associated entities?

前端 未结 3 2153
北海茫月
北海茫月 2020-12-19 08:54

Does linq to sql automatically lazy load associated entities?

I would think it would but I can\'t find an article stating it as such.

3条回答
  •  死守一世寂寞
    2020-12-19 09:46

    Yes, I believe it does. It also has a "load with" feature/semantic that allows you to batch load several things in a shotgun approach. This is useful when you know you'll need related data along with the main entity right off the bat, like to pre-cache all the data you'll need to render a single Web Page etc.

提交回复
热议问题