TypedTableBaseExtensions.Select<TRow,S> 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将每个 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
中的sourceDataRow行元素的类型。
- S
参数
- source
- TypedTableBase<TRow>
包含TypedTableBase<T>要对其调用转换函数的元素的 ADataRow。
- selector
- Func<TRow,S>
要应用于每个元素的转换函数。
返回
EnumerableRowCollection<TRow>其元素是对每个元素source调用转换函数的结果。
注解
此投影方法需要转换函数, selector以便为源序列 source中的每个值生成一个值。 如果 selector 返回的是集合本身的值,使用者必须手动遍历子序列。