ObjectQuery<T>.Skip(String, String, ObjectParameter[]) Yöntem
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
Sorgu sonuçlarını belirtilen ölçütlere göre sıralar ve belirtilen sayıda sonucu atlar.
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)
Parametreler
- keys
- String
Sonuçların sıralandığı anahtar sütunlar.
- count
- String
Atlana sonuçların sayısı. Bunun sabit veya parametre başvurusu olması gerekir.
- parameters
- ObjectParameter[]
Ayrıştırma sırasında kapsamda olması gereken isteğe bağlı bir sorgu parametreleri kümesi.
Döndürülenler
Hem ObjectQuery<T> hem de SKIP uygulanmış özgün örneğe eşdeğer yeni bir örnek.
Özel durumlar
Bağımsız değişkenlerden herhangi biri şeklindedir null.
Örnekler
Bu örnek, sorgu sonucundaki ilk üç atlandıktan sonra beş Product nesne alır ve ölçütüne göre Product.ListPricesıralanır.
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);
}
Açıklamalar
Skip yöntemi yönteminden Top sonra kullanılamaz. sonrasında TopkullandığınızdaSkip, bir yan tümcenin ORDER BY deyimi gibi çalışır.