Bewerken

Delen via


TypedTableBaseExtensions.Select<TRow,S> Method

Definition

Projects each element of a TypedTableBase<T> into a new form.

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)

Type Parameters

TRow

The type of the row elements in source, DataRow.

S

Parameters

source
TypedTableBase<TRow>

A TypedTableBase<T> that contains the DataRow elements to invoke a transformation function upon.

selector
Func<TRow,S>

A transformation function to apply to each element.

Returns

An EnumerableRowCollection<TRow> whose elements are the result of invoking the transformation function on each element of source.

Remarks

This projection method requires the transformation function, selector, to produce one value for each value in the source sequence, source. If selector returns a value that is itself a collection, the consumer must traverse the sub-sequences manually.

Applies to