/// <summary> /// Creates a query that returns elements from a sequence as long as a specified condition is true, and then skips the remaining elements. /// </summary> /// <typeparam name="TSource">The type of the elements of source.</typeparam> /// <param name="query">The query to return elements from.</param> /// <param name="predicate">A function to test each element for a condition.</param> /// <returns>A query that contains the elements from the input sequence that occur before the element at which the test no longer passes.</returns> public static IQueryExpr <IEnumerable <TSource> > TakeWhile <TSource>(this IQueryExpr <IEnumerable <TSource> > query, Expression <Func <TSource, bool> > predicate) { return(new QueryExpr <IEnumerable <TSource> >(QExpr.NewTakeWhile(predicate, query.Expr))); }