ObjectQuery<T>.Skip(String, String, ObjectParameter[]) 메서드

정의

지정된 조건으로 쿼리 결과를 정렬하고 지정된 개수의 결과를 건너뜁니다.

public:
 System::Data::Objects::ObjectQuery<T> ^ Skip(System::String ^ keys, System::String ^ count, ... cli::array <System::Data::Objects::ObjectParameter ^> ^ parameters);
public System.Data.Objects.ObjectQuery<T> Skip (string keys, string count, params System.Data.Objects.ObjectParameter[] parameters);
member this.Skip : string * string * System.Data.Objects.ObjectParameter[] -> System.Data.Objects.ObjectQuery<'T>
Public Function Skip (keys As String, count As String, ParamArray parameters As ObjectParameter()) As ObjectQuery(Of T)

매개 변수

keys
String

결과를 정렬할 기준 키 열입니다.

count
String

건너뛸 결과의 개수입니다. 상수 또는 매개 변수 참조여야 합니다.

parameters
ObjectParameter[]

구문 분석 범위에 포함되어야 하는 쿼리 매개 변수의 선택적 집합입니다.

반환

원래 인스턴스에 ORDER BYSKIP이 적용된 것과 동일한 새 ObjectQuery<T> 인스턴스입니다.

예외

인수가 null인 경우

keys이 빈 문자열인 경우

또는

count이 빈 문자열인 경우

예제

이 예제에서는 쿼리 결과에서 처음 3개를 건너뛴 후 를 기준으로 Product.ListPrice정렬된 5개의 Product 개체를 가져옵니다.

using (AdventureWorksEntities context =
    new AdventureWorksEntities())
{
    // Define the parameters used to define the "page" of returned data.
    int skipValue = 3;
    int limitValue = 5;

    // Define a query that returns a "page" or the full
    // Product data using the Skip and Top methods.
    // When Top() follows Skip(), it acts like the LIMIT statement.
    ObjectQuery<Product> query = context.Products
        .Skip("it.ListPrice", "@skip",
                new ObjectParameter("skip", skipValue))
        .Top("@limit", new ObjectParameter("limit", limitValue));

    // Iterate through the page of Product items.
    foreach (Product result in query)
        Console.WriteLine("ID: {0}; Name: {1}",
        result.ProductID, result.Name);
}

설명

메서드 다음에는 Skip 메서드를 Top 사용할 수 없습니다. 를 Skip사용하는 Top 경우 절의 ORDER BYLIMIT 문처럼 작동합니다.

적용 대상

추가 정보