示例#1
0
 /// <summary>
 /// Creates a new query that projects in parallel each element of a sequence into a new form.
 /// </summary>
 /// <typeparam name="TSource">The type of the elements of the query.</typeparam>
 /// <typeparam name="TResult">The type of the value returned by selector.</typeparam>
 /// <param name="query">A query whose values to invoke a transform function on.</param>
 /// <param name="selector">A transform function to apply to each element.</param>
 /// <returns>A query whose elements will be the result of invoking the transform function on each element of source, in parallel.</returns>
 public static IParallelQueryExpr <IEnumerable <TResult> > Select <TSource, TResult>(this IParallelQueryExpr <IEnumerable <TSource> > query, Expression <Func <TSource, TResult> > selector)
 {
     return(new ParallelQueryExpr <IEnumerable <TResult> >(QExpr.NewTransform(selector, query.Expr)));
 }