DataServiceQueryContinuation<T> 클래스

정의

페이징된 WCF Data Services 쿼리 결과의 다음 페이지를 반환하는 URI를 캡슐화합니다.

generic <typename T>
public ref class DataServiceQueryContinuation sealed : System::Data::Services::Client::DataServiceQueryContinuation
public sealed class DataServiceQueryContinuation<T> : System.Data.Services.Client.DataServiceQueryContinuation
type DataServiceQueryContinuation<'T> = class
    inherit DataServiceQueryContinuation
Public NotInheritable Class DataServiceQueryContinuation(Of T)
Inherits DataServiceQueryContinuation

형식 매개 변수

T

연속 토큰의 형식입니다.

상속
DataServiceQueryContinuation<T>

예제

이 예제에서는 루프를 do…while 사용하여 데이터 서비스의 페이징된 결과에서 엔터티를 로드 Customers 합니다.

// Create the DataServiceContext using the service URI.
NorthwindEntities context = new NorthwindEntities(svcUri);
DataServiceQueryContinuation<Customer> token = null;
int pageCount = 0;

try
{
    // Execute the query for all customers and get the response object.
    QueryOperationResponse<Customer> response =
        context.Customers.Execute() as QueryOperationResponse<Customer>;

    // With a paged response from the service, use a do...while loop
    // to enumerate the results before getting the next link.
    do
    {
        // Write the page number.
        Console.WriteLine("Page {0}:", pageCount++);

        // If nextLink is not null, then there is a new page to load.
        if (token != null)
        {
            // Load the new page from the next link URI.
            response = context.Execute<Customer>(token)
                as QueryOperationResponse<Customer>;
        }

        // Enumerate the customers in the response.
        foreach (Customer customer in response)
        {
            Console.WriteLine("\tCustomer Name: {0}", customer.CompanyName);
        }
    }

    // Get the next link, and continue while there is a next link.
    while ((token = response.GetContinuation()) != null);
}
catch (DataServiceQueryException ex)
{
    throw new ApplicationException(
        "An error occurred during query execution.", ex);
}
' Create the DataServiceContext using the service URI.
Dim context = New NorthwindEntities(svcUri)
Dim token As DataServiceQueryContinuation(Of Customer) = Nothing
Dim pageCount = 0

Try
    ' Execute the query for all customers and get the response object.
    Dim response As QueryOperationResponse(Of Customer) = _
        CType(context.Customers.Execute(), QueryOperationResponse(Of Customer))

    ' With a paged response from the service, use a do...while loop 
    ' to enumerate the results before getting the next link.
    Do
        ' Write the page number.
        Console.WriteLine("Page {0}:", pageCount + 1)

        ' If nextLink is not null, then there is a new page to load.
        If token IsNot Nothing Then
            ' Load the new page from the next link URI.
            response = CType(context.Execute(Of Customer)(token),  _
            QueryOperationResponse(Of Customer))
        End If

        ' Enumerate the customers in the response.
        For Each customer As Customer In response
            Console.WriteLine(vbTab & "Customer Name: {0}", customer.CompanyName)
        Next

        ' Get the next link, and continue while there is a next link.
        token = response.GetContinuation()
    Loop While token IsNot Nothing
Catch ex As DataServiceQueryException
    Throw New ApplicationException( _
            "An error occurred during query execution.", ex)
End Try

속성

NextLinkUri

페이징된 쿼리 결과에서 다음 데이터 페이지를 반환하는 데 사용되는 URI를 가져옵니다.

(다음에서 상속됨 DataServiceQueryContinuation)

메서드

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

다음 링크 URI를 문자열로 반환합니다.

(다음에서 상속됨 DataServiceQueryContinuation)

적용 대상

추가 정보