ObjectQuery<T>.Skip(String, String, ObjectParameter[]) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
쿼리 결과를 지정된 기준으로 정렬하고 지정된 수의 결과를 건너뜁니다.
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 BY와 SKIP이 모두 적용된 원래 인스턴스와 동일한 새 ObjectQuery<T> 인스턴스입니다.
예외
모든 인수는 .입니다 null.
예제
이 예제에서는 쿼리 결과에서 처음 3개를 건너뛴 후 정렬된 5개의 Product 개체를 Product.ListPrice가져옵니다.
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 문처럼 작동합니다.