How to eager load sibling data using LINQ to SQL?

前端 未结 2 2127
不知归路
不知归路 2021-02-19 02:38

The goal is to issue the fewest queries to SQL Server using LINQ to SQL without using anonymous types. The return type for the method will need to be IList

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-19 02:49

    What you have should be correct, you need to add this dataContext.DeferredLoadingEnabled = false; in addition to the LoadOptions you are already setting.

提交回复
热议问题