Ler en inglés

Compartir por


DataServiceQueryContinuation<T> Clase

Definición

Encapsula un URI que devuelve la página siguiente de un resultado de consulta de WCF Data Services paginado.

C#
public sealed class DataServiceQueryContinuation<T> : System.Data.Services.Client.DataServiceQueryContinuation

Parámetros de tipo

T

El tipo de token de continuación.

Herencia
DataServiceQueryContinuation<T>

Ejemplos

En este ejemplo se usa un bucle do…while para cargar las entidades Customers desde los resultados paginados del servicio de datos.

C#
// 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);
}

Propiedades

NextLinkUri

Obtiene el URI que se utiliza para devolver la página siguiente de datos de un resultado de consulta paginado.

(Heredado de DataServiceQueryContinuation)

Métodos

Equals(Object)

Determina si el objeto especificado es igual que el objeto actual.

(Heredado de Object)
GetHashCode()

Sirve como la función hash predeterminada.

(Heredado de Object)
GetType()

Obtiene el Type de la instancia actual.

(Heredado de Object)
MemberwiseClone()

Crea una copia superficial del Object actual.

(Heredado de Object)
ToString()

Devuelve el siguiente vínculo URI como una cadena.

(Heredado de DataServiceQueryContinuation)

Se aplica a

Produto Versións
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

Consulte también