Force Linq to not delay execution

前端 未结 4 1989
礼貌的吻别
礼貌的吻别 2021-02-12 15:12

In fact, this is the same question as this post:

How can I make sure my LINQ queries execute when called in my DAL, not in a delayed fashion?

But since he didn\'

4条回答
  •  误落风尘
    2021-02-12 15:46

    There is a LoadOptions property in the DataContext class that could help you fetch the data more eagerly.

    Else you could use a few clever placed ToList() 's.

提交回复
热议问题