@@ -15,39 +15,44 @@ public static IQueryable<T> ConditionalInclude<T>(this IQueryable<T> source, boo
1515 ? source . Include ( include )
1616 : source ;
1717
18- public static IQueryable < T > ConditionalWhere < T > ( this IQueryable < T > source , bool condition , Expression < Func < T , bool > > predicate ) =>
19- condition
18+ public static IQueryable < T > ConditionalWhere < T > ( this IQueryable < T > source , bool condition , Expression < Func < T , bool > > predicate )
19+ => condition
2020 ? source . Where ( predicate )
2121 : source ;
2222
23- public static IQueryable < T > ConditionalTake < T > ( this IQueryable < T > source , bool condition , int count ) =>
24- condition
23+ public static IQueryable < T > ConditionalTake < T > ( this IQueryable < T > source , bool condition , int count )
24+ => condition
2525 ? source . Take ( count )
2626 : source ;
2727
28- public static IQueryable < T > ConditionalTake < T > ( this IQueryable < T > source , bool condition , Range range ) =>
29- condition
28+ public static IQueryable < T > ConditionalTake < T > ( this IQueryable < T > source , bool condition , Range range )
29+ => condition
3030 ? source . Take ( range )
3131 : source ;
3232
33- public static IQueryable < T > ConditionalOrderBy < T > ( this IQueryable < T > source , bool condition , Expression < Func < T , object > > orderBy ) =>
34- condition
33+ public static IQueryable < T > ConditionalOrderBy < T > ( this IQueryable < T > source , bool condition , Expression < Func < T , object > > orderBy )
34+ => condition
3535 ? source . OrderBy ( orderBy )
3636 : source ;
3737
38- public static IQueryable < TSource > ConditionalOrderBy < TSource , TKey > ( this IQueryable < TSource > source , bool condition , Expression < Func < TSource , TKey > > orderBy , IComparer < TKey > ? comparer ) =>
39- condition
38+ public static IQueryable < TSource > ConditionalOrderBy < TSource , TKey > ( this IQueryable < TSource > source , bool condition , Expression < Func < TSource , TKey > > orderBy , IComparer < TKey > ? comparer )
39+ => condition
4040 ? source . OrderBy ( orderBy , comparer )
4141 : source ;
4242
43- public static IQueryable < TSource > ConditionalOrderByNotNull < TSource , TKey > ( this IQueryable < TSource > source , Expression < Func < TSource , TKey > > ? orderBy ) =>
44- orderBy is not null
43+ public static IQueryable < TSource > ConditionalOrderByNotNull < TSource , TKey > ( this IQueryable < TSource > source , Expression < Func < TSource , TKey > > ? orderBy )
44+ => orderBy is not null
4545 ? source . OrderBy ( orderBy )
4646 : source ;
4747
4848
49- public static IQueryable < TSource > ConditionalQueryable < TSource > ( this IQueryable < TSource > source , bool condition , Func < IQueryable < TSource > , IQueryable < TSource > > queryableFunc ) =>
50- condition
49+ public static IQueryable < T > ConditionalQueryable < T > ( this IQueryable < T > source , bool condition , Func < IQueryable < T > , IQueryable < T > > queryableFunc )
50+ => condition
5151 ? queryableFunc ( source )
5252 : source ;
53+
54+ public static IQueryable < T > ConditionalReverse < T > ( this IQueryable < T > source , bool reverse )
55+ => reverse
56+ ? source . Reverse ( )
57+ : source ;
5358}
0 commit comments