这听起来像你想使用寻呼饼干。例如查看链接和更多信息。
https://msdn.microsoft.com/en-us/library/gg328046.aspx
编辑
您需要重新创建你的循环的每一次迭代寻呼饼干,但它的基础上的现有寻呼的cookie。
下面的代码来自我链接到的示例。
public string CreateXml(string xml, string cookie, int page, int count)
{
StringReader stringReader = new StringReader(xml);
XmlTextReader reader = new XmlTextReader(stringReader);
// Load document
XmlDocument doc = new XmlDocument();
doc.Load(reader);
return CreateXml(doc, cookie, page, count);
}
这第一种方法需要您的FetchXml,pagingcookie,当前页面和项目数每页返回。它依次调用以下:
public string CreateXml(XmlDocument doc, string cookie, int page, int count)
{
XmlAttributeCollection attrs = doc.DocumentElement.Attributes;
if (cookie != null)
{
XmlAttribute pagingAttr = doc.CreateAttribute("paging-cookie");
pagingAttr.Value = cookie;
attrs.Append(pagingAttr);
}
XmlAttribute pageAttr = doc.CreateAttribute("page");
pageAttr.Value = System.Convert.ToString(page);
attrs.Append(pageAttr);
XmlAttribute countAttr = doc.CreateAttribute("count");
countAttr.Value = System.Convert.ToString(count);
attrs.Append(countAttr);
StringBuilder sb = new StringBuilder(1024);
StringWriter stringWriter = new StringWriter(sb);
XmlTextWriter writer = new XmlTextWriter(stringWriter);
doc.WriteTo(writer);
writer.Close();
return sb.ToString();
}
这建立了新的FetchXml返回结果的下一页,但使用当前的页面cookie来确定哪些是需要返回下一页。
然后,只需要调用以下内容即可获得结果;
请仔细阅读链接中的完整代码示例,并确保明白它在做什么。它在那里。
等待,您可以设法执行2个RetrieveMultiple结果集(实体A + B)的联合,以在您的方法中获取合并的数据集。但寻呼曲奇是用于RetreiveMultiple调用本身分页..所以你必须使用LINQ从本地合并数据集分页.. –