Beispiel #1
0
        /// <summary>
        /// Creates a new query that projects 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.</returns>
        public static ICloudQueryExpr <IEnumerable <TResult> > Select <TSource, TResult>(this ICloudQueryExpr <IEnumerable <TSource> > query, Expression <Func <TSource, TResult> > selector)
        {
            var cq = CloudQueryExpr.NewTransform(selector.AsSerializable(), query.Expr);

            return(new CloudQueryExpr <IEnumerable <TResult> >(cq));
        }