Пример #1
0
 /// <summary>
 /// Groups the elements of a sequence according to a specified key selector function.
 /// </summary>
 /// <param name="source"> An <see cref="IQueryable" /> whose elements to group.</param>
 /// <param name="keySelector"> A function to extract the key for each element.</param>
 /// <returns>
 /// An <see cref="IQueryable"/> with <see cref="IGrouping{TKey,TElement}"/> items, 
 /// whose elements contains a sequence of objects and a key.
 /// </returns>
 public static IQueryable GroupBy(this IQueryable source, LambdaExpression keySelector)
 {
     return source.CallQueryableMethod("GroupBy", keySelector);
 }
Пример #2
0
 /// <summary>
 /// Sorts the elements of a sequence in descending order according to a key.
 /// </summary>
 /// <returns>
 /// An <see cref="IQueryable" /> whose elements are sorted in descending order according to a key.
 /// </returns>
 /// <param name="source">
 /// A sequence of values to order.
 /// </param>
 /// <param name="keySelector">
 /// A function to extract a key from an element.
 /// </param>
 public static IQueryable OrderByDescending(this IQueryable source, LambdaExpression keySelector)
 {
     return source.CallQueryableMethod("OrderByDescending", keySelector);
 }
Пример #3
0
 /// <summary>
 /// Projects each element of a sequence into a new form.
 /// </summary>
 /// <returns>
 /// An <see cref="IQueryable" /> whose elements are the result of invoking a 
 /// projection selector on each element of <paramref name="source" />.
 /// </returns>
 /// <param name="source"> A sequence of values to project. </param>
 /// <param name="selector"> A projection function to apply to each element. </param>
 public static IQueryable Select(this IQueryable source, LambdaExpression selector)
 {
     return source.CallQueryableMethod("Select", selector);
 }