Queryable.Chunk<TSource>(IQueryable<TSource>, Int32) Metoda
Definicja
Ważne
Niektóre informacje odnoszą się do produktu w wersji wstępnej, który może zostać znacząco zmodyfikowany przed wydaniem. Firma Microsoft nie udziela żadnych gwarancji, jawnych lub domniemanych, w odniesieniu do informacji podanych w tym miejscu.
Podziel elementy sekwencji na fragmenty rozmiaru na najwyżej size.
public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
static System::Linq::IQueryable<cli::array <TSource> ^> ^ Chunk(System::Linq::IQueryable<TSource> ^ source, int size);
public static System.Linq.IQueryable<TSource[]> Chunk<TSource>(this System.Linq.IQueryable<TSource> source, int size);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Enumerating collections as IQueryable can require creating new generic types or methods, which requires creating code at runtime. This may not work when AOT compiling.")]
public static System.Linq.IQueryable<TSource[]> Chunk<TSource>(this System.Linq.IQueryable<TSource> source, int size);
static member Chunk : System.Linq.IQueryable<'Source> * int -> System.Linq.IQueryable<'Source[]>
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Enumerating collections as IQueryable can require creating new generic types or methods, which requires creating code at runtime. This may not work when AOT compiling.")>]
static member Chunk : System.Linq.IQueryable<'Source> * int -> System.Linq.IQueryable<'Source[]>
<Extension()>
Public Function Chunk(Of TSource) (source As IQueryable(Of TSource), size As Integer) As IQueryable(Of TSource())
Parametry typu
- TSource
Typ elementów źródła.
Parametry
- source
- IQueryable<TSource>
Element IEnumerable<T> , którego elementy do fragmentowania.
- size
- Int32
Maksymalny rozmiar każdego fragmentu.
Zwraca
Element IEnumerable<T> zawierający elementy, które sekwencja wejściowa podzielona na fragmenty rozmiaru size.
- Atrybuty
Wyjątki
Parametr source ma wartość null.
size jest poniżej 1.
Uwagi
Każdy fragment z wyjątkiem ostatniego będzie mieć rozmiar size.
Ostatni fragment będzie zawierać pozostałe elementy i może mieć mniejszy rozmiar.