@@ -241,6 +241,81 @@ public static IQueryable<TResult> GroupJoin<TOuter, TInner, TKey, TResult>(this
241
241
CachedReflectionInfo . GroupJoin_TOuter_TInner_TKey_TResult_6 ( typeof ( TOuter ) , typeof ( TInner ) , typeof ( TKey ) , typeof ( TResult ) ) , outer . Expression , GetSourceExpression ( inner ) , Expression . Quote ( outerKeySelector ) , Expression . Quote ( innerKeySelector ) , Expression . Quote ( resultSelector ) , Expression . Constant ( comparer , typeof ( IEqualityComparer < TKey > ) ) ) ) ;
242
242
}
243
243
244
+ /// <summary>
245
+ /// Sorts the elements of a sequence in ascending order.
246
+ /// </summary>
247
+ /// <typeparam name="T">The type of the elements of <paramref name="source"/>.</typeparam>
248
+ /// <param name="source">A sequence of values to order.</param>
249
+ /// <returns>An <see cref="IOrderedEnumerable{TElement}"/> whose elements are sorted.</returns>
250
+ /// <exception cref="ArgumentNullException"><paramref name="source"/> is <see langword="null"/>.</exception>
251
+ /// <remarks>
252
+ /// This method has at least one parameter of type <see cref="Expression{TDelegate}"/> whose type argument is one
253
+ /// of the <see cref="Func{T,TResult}"/> types.
254
+ /// For these parameters, you can pass in a lambda expression and it will be compiled to an <see cref="Expression{TDelegate}"/>.
255
+ ///
256
+ /// The <see cref="Order{T}(IQueryable{T})"/> method generates a <see cref="MethodCallExpression"/> that represents
257
+ /// calling <see cref="Enumerable.Order{T}(IEnumerable{T})"/> itself as a constructed generic method.
258
+ /// It then passes the <see cref="MethodCallExpression"/> to the <see cref="IQueryProvider.CreateQuery{TElement}(Expression)"/> method
259
+ /// of the <see cref="IQueryProvider"/> represented by the <see cref="IQueryable.Provider"/> property of the <paramref name="source"/>
260
+ /// parameter. The result of calling <see cref="IQueryProvider.CreateQuery{TElement}(Expression)"/> is cast to
261
+ /// type <see cref="IOrderedQueryable{T}"/> and returned.
262
+ ///
263
+ /// The query behavior that occurs as a result of executing an expression tree
264
+ /// that represents calling <see cref="Enumerable.Order{T}(IEnumerable{T})"/>
265
+ /// depends on the implementation of the <paramref name="source"/> parameter.
266
+ /// The expected behavior is that it sorts the elements of <paramref name="source"/> by itself.
267
+ /// </remarks>
268
+ [ DynamicDependency ( "Order`1" , typeof ( Enumerable ) ) ]
269
+ public static IOrderedQueryable < T > Order < T > ( this IQueryable < T > source )
270
+ {
271
+ ArgumentNullException . ThrowIfNull ( source ) ;
272
+
273
+ return ( IOrderedQueryable < T > ) source . Provider . CreateQuery < T > (
274
+ Expression . Call (
275
+ null ,
276
+ CachedReflectionInfo . Order_T_1 ( typeof ( T ) ) ,
277
+ source . Expression
278
+ ) ) ;
279
+ }
280
+
281
+ /// <summary>
282
+ /// Sorts the elements of a sequence in ascending order.
283
+ /// </summary>
284
+ /// <typeparam name="T">The type of the elements of <paramref name="source"/>.</typeparam>
285
+ /// <param name="source">A sequence of values to order.</param>
286
+ /// <param name="comparer">An <see cref="IComparer{T}"/> to compare elements.</param>
287
+ /// <returns>An <see cref="IOrderedEnumerable{TElement}"/> whose elements are sorted.</returns>
288
+ /// <exception cref="ArgumentNullException"><paramref name="source"/> is <see langword="null"/>.</exception>
289
+ /// <remarks>
290
+ /// This method has at least one parameter of type <see cref="Expression{TDelegate}"/> whose type argument is one
291
+ /// of the <see cref="Func{T,TResult}"/> types.
292
+ /// For these parameters, you can pass in a lambda expression and it will be compiled to an <see cref="Expression{TDelegate}"/>.
293
+ ///
294
+ /// The <see cref="Order{T}(IQueryable{T})"/> method generates a <see cref="MethodCallExpression"/> that represents
295
+ /// calling <see cref="Enumerable.Order{T}(IEnumerable{T})"/> itself as a constructed generic method.
296
+ /// It then passes the <see cref="MethodCallExpression"/> to the <see cref="IQueryProvider.CreateQuery{TElement}(Expression)"/> method
297
+ /// of the <see cref="IQueryProvider"/> represented by the <see cref="IQueryable.Provider"/> property of the <paramref name="source"/>
298
+ /// parameter. The result of calling <see cref="IQueryProvider.CreateQuery{TElement}(Expression)"/> is cast to
299
+ /// type <see cref="IOrderedQueryable{T}"/> and returned.
300
+ ///
301
+ /// The query behavior that occurs as a result of executing an expression tree
302
+ /// that represents calling <see cref="Enumerable.Order{T}(IEnumerable{T})"/>
303
+ /// depends on the implementation of the <paramref name="source"/> parameter.
304
+ /// The expected behavior is that it sorts the elements of <paramref name="source"/> by itself.
305
+ /// </remarks>
306
+ [ DynamicDependency ( "Order`1" , typeof ( Enumerable ) ) ]
307
+ public static IOrderedQueryable < T > Order < T > ( this IQueryable < T > source , IComparer < T > comparer )
308
+ {
309
+ ArgumentNullException . ThrowIfNull ( source ) ;
310
+
311
+ return ( IOrderedQueryable < T > ) source . Provider . CreateQuery < T > (
312
+ Expression . Call (
313
+ null ,
314
+ CachedReflectionInfo . Order_T_2 ( typeof ( T ) ) ,
315
+ source . Expression , Expression . Constant ( comparer , typeof ( IComparer < T > ) )
316
+ ) ) ;
317
+ }
318
+
244
319
[ DynamicDependency ( "OrderBy`2" , typeof ( Enumerable ) ) ]
245
320
public static IOrderedQueryable < TSource > OrderBy < TSource , TKey > ( this IQueryable < TSource > source , Expression < Func < TSource , TKey > > keySelector )
246
321
{
@@ -269,6 +344,81 @@ public static IOrderedQueryable<TSource> OrderBy<TSource, TKey>(this IQueryable<
269
344
) ) ;
270
345
}
271
346
347
+ /// <summary>
348
+ /// Sorts the elements of a sequence in descending order.
349
+ /// </summary>
350
+ /// <typeparam name="T">The type of the elements of <paramref name="source"/>.</typeparam>
351
+ /// <param name="source">A sequence of values to order.</param>
352
+ /// <returns>An <see cref="IOrderedEnumerable{TElement}"/> whose elements are sorted.</returns>
353
+ /// <exception cref="ArgumentNullException"><paramref name="source"/> is <see langword="null"/>.</exception>
354
+ /// <remarks>
355
+ /// This method has at least one parameter of type <see cref="Expression{TDelegate}"/> whose type argument is one
356
+ /// of the <see cref="Func{T,TResult}"/> types.
357
+ /// For these parameters, you can pass in a lambda expression and it will be compiled to an <see cref="Expression{TDelegate}"/>.
358
+ ///
359
+ /// The <see cref="Order{T}(IQueryable{T})"/> method generates a <see cref="MethodCallExpression"/> that represents
360
+ /// calling <see cref="Enumerable.Order{T}(IEnumerable{T})"/> itself as a constructed generic method.
361
+ /// It then passes the <see cref="MethodCallExpression"/> to the <see cref="IQueryProvider.CreateQuery{TElement}(Expression)"/> method
362
+ /// of the <see cref="IQueryProvider"/> represented by the <see cref="IQueryable.Provider"/> property of the <paramref name="source"/>
363
+ /// parameter. The result of calling <see cref="IQueryProvider.CreateQuery{TElement}(Expression)"/> is cast to
364
+ /// type <see cref="IOrderedQueryable{T}"/> and returned.
365
+ ///
366
+ /// The query behavior that occurs as a result of executing an expression tree
367
+ /// that represents calling <see cref="Enumerable.Order{T}(IEnumerable{T})"/>
368
+ /// depends on the implementation of the <paramref name="source"/> parameter.
369
+ /// The expected behavior is that it sorts the elements of <paramref name="source"/> by itself.
370
+ /// </remarks>
371
+ [ DynamicDependency ( "OrderDescending`1" , typeof ( Enumerable ) ) ]
372
+ public static IOrderedQueryable < T > OrderDescending < T > ( this IQueryable < T > source )
373
+ {
374
+ ArgumentNullException . ThrowIfNull ( source ) ;
375
+
376
+ return ( IOrderedQueryable < T > ) source . Provider . CreateQuery < T > (
377
+ Expression . Call (
378
+ null ,
379
+ CachedReflectionInfo . OrderDescending_T_1 ( typeof ( T ) ) ,
380
+ source . Expression
381
+ ) ) ;
382
+ }
383
+
384
+ /// <summary>
385
+ /// Sorts the elements of a sequence in descending order.
386
+ /// </summary>
387
+ /// <typeparam name="T">The type of the elements of <paramref name="source"/>.</typeparam>
388
+ /// <param name="source">A sequence of values to order.</param>
389
+ /// <param name="comparer">An <see cref="IComparer{T}"/> to compare elements.</param>
390
+ /// <returns>An <see cref="IOrderedEnumerable{TElement}"/> whose elements are sorted.</returns>
391
+ /// <exception cref="ArgumentNullException"><paramref name="source"/> is <see langword="null"/>.</exception>
392
+ /// <remarks>
393
+ /// This method has at least one parameter of type <see cref="Expression{TDelegate}"/> whose type argument is one
394
+ /// of the <see cref="Func{T,TResult}"/> types.
395
+ /// For these parameters, you can pass in a lambda expression and it will be compiled to an <see cref="Expression{TDelegate}"/>.
396
+ ///
397
+ /// The <see cref="Order{T}(IQueryable{T})"/> method generates a <see cref="MethodCallExpression"/> that represents
398
+ /// calling <see cref="Enumerable.Order{T}(IEnumerable{T})"/> itself as a constructed generic method.
399
+ /// It then passes the <see cref="MethodCallExpression"/> to the <see cref="IQueryProvider.CreateQuery{TElement}(Expression)"/> method
400
+ /// of the <see cref="IQueryProvider"/> represented by the <see cref="IQueryable.Provider"/> property of the <paramref name="source"/>
401
+ /// parameter. The result of calling <see cref="IQueryProvider.CreateQuery{TElement}(Expression)"/> is cast to
402
+ /// type <see cref="IOrderedQueryable{T}"/> and returned.
403
+ ///
404
+ /// The query behavior that occurs as a result of executing an expression tree
405
+ /// that represents calling <see cref="Enumerable.Order{T}(IEnumerable{T})"/>
406
+ /// depends on the implementation of the <paramref name="source"/> parameter.
407
+ /// The expected behavior is that it sorts the elements of <paramref name="source"/> by itself.
408
+ /// </remarks>
409
+ [ DynamicDependency ( "OrderDescending`1" , typeof ( Enumerable ) ) ]
410
+ public static IOrderedQueryable < T > OrderDescending < T > ( this IQueryable < T > source , IComparer < T > comparer )
411
+ {
412
+ ArgumentNullException . ThrowIfNull ( source ) ;
413
+
414
+ return ( IOrderedQueryable < T > ) source . Provider . CreateQuery < T > (
415
+ Expression . Call (
416
+ null ,
417
+ CachedReflectionInfo . OrderDescending_T_2 ( typeof ( T ) ) ,
418
+ source . Expression , Expression . Constant ( comparer , typeof ( IComparer < T > ) )
419
+ ) ) ;
420
+ }
421
+
272
422
[ DynamicDependency ( "OrderByDescending`2" , typeof ( Enumerable ) ) ]
273
423
public static IOrderedQueryable < TSource > OrderByDescending < TSource , TKey > ( this IQueryable < TSource > source , Expression < Func < TSource , TKey > > keySelector )
274
424
{
0 commit comments