【问题标题】:Returns all rows from a Odata wcf service从 Odata wcf 服务返回所有行
【发布时间】:2013-10-11 20:52:12
【问题描述】:

我正在尝试返回我的 linq 查询中的所有行并遍历它以执行其他业务逻辑。我的代码示例如下:-

var ctx = new ServiceRelated.EmsODataContext(serviceExecutionUri);
var andondata = from data in ctx.SEWInstanceViewItems
                select new { ID = data.SEWInstanceID, ServiceType =          data.ServiceTypeName, Complex = data.EventArea, AssignedTo = data.AssignedTo, Claimed = data.Status };

foreach (var boarddata in andondata)
{
    string strComeplex = boarddata.Complex.ToString();
}

我在代码和 linqpad 中意识到,尽管返回了所有行(超过 80 行)并提供了转到下一页的链接,但查询只返回了 50 行。

我假设已经定义了一些服务器端页面大小。请指导我使用示例代码一次性访问所有行。

提前致谢

【问题讨论】:

标签: linq odata


【解决方案1】:

您需要使用SetEntitySetPageSize 将结果集页面大小设置为足够大的大小

【讨论】:

    猜你喜欢
    • 2011-04-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多