Service 从ACS获取服务标识时可以使用分页吗

Service 从ACS获取服务标识时可以使用分页吗,service,azure,identity,acs,Service,Azure,Identity,Acs,背景 我需要在Azure ACS中注册的所有服务标识名称的列表。我有一个Azure管理服务参考,我从中获得。在本讨论中,“myaccesscontrol”前缀是任意的。如果我理解正确,您可以使用不同的订阅命名空间前缀并获得相同的结果。这是Azure在我订阅时提供给我的服务端点。它公开了一个ManagementService接口。当我获得服务标识列表时 DataServiceQuery<ServiceIdentity> identities = managementService.

背景 我需要在Azure ACS中注册的所有服务标识名称的列表。我有一个Azure管理服务参考,我从中获得。在本讨论中,“myaccesscontrol”前缀是任意的。如果我理解正确,您可以使用不同的订阅命名空间前缀并获得相同的结果。这是Azure在我订阅时提供给我的服务端点。它公开了一个ManagementService接口。当我获得服务标识列表时

  DataServiceQuery<ServiceIdentity> identities = managementService.ServiceIdentities;
dataservicequeryidentifies=managementService.serviceIdentifies;
我得到一个对象,该对象具有我期望的所有身份的计数。当我展开列表时,我得到前50个。这是一个典型的分页响应,我希望有一个延续令牌,可以让我获得下一个“页面”

问题 我看不出如何使用ManagementServiceReference.ManagementService接口获取延续令牌

讨论 How to:Load Paged Results(WCF Data Services)at提供了一个示例,其中可以查询来自LINQ上下文的QueryOperationResponse响应,以便使用 token=response.GetContinuation() QueryOperationResponse是从LINQ上下文Execute()检索的

在我拥有的一些Azure示例代码中,有一些BLOB、表和队列的分页示例,其中数据收集在ResultSegment中。ResultSegment有一个布尔HasMoreResults成员、一个ResultContinuationToken ContinuationToken成员,以及接受和维护这些成员以支持分页操作的方法


我不知道如何从DataServiceQuery获取延续。我看不到Azure公开的ManagementServiceReference.ManagementService支持服务标识的分页列表,即使该服务显然正在分页它发送给我的结果。您能给我指出一篇正确的文章,它将向我展示如何以一种方式处理DataServiceQuery,以使我能够重新获得一个延续吗?

使用可用的管理服务示例项目,您需要的内容如下所示:

ManagementService mgmtSvc = ManagementServiceHelper.CreateManagementServiceClient();
List<ServiceIdentity> serviceIdentities = new List<ServiceIdentity>();

// Get the first page
var queryResponse = mgmtSvc.ServiceIdentities.Execute();
serviceIdentities.AddRange( queryResponse.ToList() );

// Get the rest
while ( null != ( (QueryOperationResponse)queryResponse ).GetContinuation() )
{
    DataServiceQueryContinuation<ServiceIdentity> continuation =
        ( (QueryOperationResponse<ServiceIdentity>)queryResponse ).GetContinuation();
    queryResponse = mgmtSvc.Execute( continuation );
    serviceIdentities.AddRange( queryResponse.ToList() );
}
ManagementService mgmtSvc=managementserviceheloper.CreateManagementServiceClient();
List ServiceIdentifies=新列表();
//获取第一页
var queryResponse=mgmtSvc.serviceIdentifications.Execute();
ServiceIdentifications.AddRange(queryResponse.ToList());
//得到其余的
while(null!=((QueryOperationResponse)queryResponse.GetContinuation())
{
DataServiceQueryContinuation延续=
((QueryOperationResponse)queryResponse.GetContinuation();
queryResponse=mgmtSvc.Execute(continuation);
ServiceIdentifications.AddRange(queryResponse.ToList());
}

A谢谢。在我的机器上工作。我觉得打字要求有点难以理解,尽管我想我会习惯的。