.Skip().Take() on Entity Framework Navigation Properties is executing SELECT * on my SQL Server

后端 未结 2 1668
别跟我提以往
别跟我提以往 2021-02-02 03:32

I have a method on my generated partial class like this:

var pChildren = this.Children
    .Skip(skipRelated)
    .Take(takeRelated)
    .ToList();
2条回答
  •  别跟我提以往
    2021-02-02 03:32

    Does it help if you call Skip on the result of Take? i.e.

    table.Take(takeCount+skipCount).Skip(skipCount).ToList()
    

    Also, see

    • TOP/LIMIT Support for LINQ?

提交回复
热议问题