TypedTableBaseExtensions.Select<TRow,S> 方法

定義

TypedTableBase<T> 的各個項目投影成一個新的表單。

public:
generic <typename TRow, typename S>
 where TRow : System::Data::DataRow[System::Runtime::CompilerServices::Extension]
 static System::Data::EnumerableRowCollection<S> ^ Select(System::Data::TypedTableBase<TRow> ^ source, Func<TRow, S> ^ selector);
public static System.Data.EnumerableRowCollection<S> Select<TRow,S> (this System.Data.TypedTableBase<TRow> source, Func<TRow,S> selector) where TRow : System.Data.DataRow;
static member Select : System.Data.TypedTableBase<'Row (requires 'Row :> System.Data.DataRow)> * Func<'Row, 'S (requires 'Row :> System.Data.DataRow)> -> System.Data.EnumerableRowCollection<'S> (requires 'Row :> System.Data.DataRow)
<Extension()>
Public Function Select(Of TRow As DataRow, S As DataRow) (source As TypedTableBase(Of TRow), selector As Func(Of TRow, S)) As EnumerableRowCollection(Of S)

類型參數

TRow

source 中資料列項目的型別,通常是 DataRow

S

參數

source
TypedTableBase<TRow>

TypedTableBase<T>,包含要對其叫用轉換函式的 DataRow 項目。

selector
Func<TRow,S>

要套用至各個項目的轉換函式。

傳回

EnumerableRowCollection<TRow>,其項目是對 source 的各個項目叫用轉換函式的結果。

備註

此投影方法需要轉換函式 selector,才能針對來源序列 source中的每個值產生一個值。 如果 傳 selector 回本身為集合的值,取用者必須手動周遊子序列。

適用於