Show / Hide Table of Contents

Class AbpQueryableExtensions

Some useful extension methods for .

Inheritance
System.Object
AbpQueryableExtensions
Namespace: System.Linq
Assembly: Volo.Abp.Core.dll
Syntax
public static class AbpQueryableExtensions : object

Methods

PageBy<T>(IQueryable<T>, Int32, Int32)

Used for paging. Can be used as an alternative to Skip(...).Take(...) chaining.

Declaration
public static IQueryable<T> PageBy<T>(this IQueryable<T> query, int skipCount, int maxResultCount)
Parameters
Type Name Description
IQueryable<T> query
System.Int32 skipCount
System.Int32 maxResultCount
Returns
Type Description
IQueryable<T>
Type Parameters
Name Description
T

PageBy<T, TQueryable>(TQueryable, Int32, Int32)

Used for paging. Can be used as an alternative to Skip(...).Take(...) chaining.

Declaration
public static TQueryable PageBy<T, TQueryable>(this TQueryable query, int skipCount, int maxResultCount)

    where TQueryable : IQueryable<T>
Parameters
Type Name Description
TQueryable query
System.Int32 skipCount
System.Int32 maxResultCount
Returns
Type Description
TQueryable
Type Parameters
Name Description
T
TQueryable

WhereIf<T>(IQueryable<T>, Boolean, Expression<Func<T, Boolean>>)

Filters a by given predicate if given condition is true.

Declaration
public static IQueryable<T> WhereIf<T>(this IQueryable<T> query, bool condition, Expression<Func<T, bool>> predicate)
Parameters
Type Name Description
IQueryable<T> query

Queryable to apply filtering

System.Boolean condition

A boolean value

Expression<Func<T, System.Boolean>> predicate

Predicate to filter the query

Returns
Type Description
IQueryable<T>

Filtered or not filtered query based on condition

Type Parameters
Name Description
T

WhereIf<T>(IQueryable<T>, Boolean, Expression<Func<T, Int32, Boolean>>)

Filters a by given predicate if given condition is true.

Declaration
public static IQueryable<T> WhereIf<T>(this IQueryable<T> query, bool condition, Expression<Func<T, int, bool>> predicate)
Parameters
Type Name Description
IQueryable<T> query

Queryable to apply filtering

System.Boolean condition

A boolean value

Expression<Func<T, System.Int32, System.Boolean>> predicate

Predicate to filter the query

Returns
Type Description
IQueryable<T>

Filtered or not filtered query based on condition

Type Parameters
Name Description
T

WhereIf<T, TQueryable>(TQueryable, Boolean, Expression<Func<T, Boolean>>)

Filters a by given predicate if given condition is true.

Declaration
public static TQueryable WhereIf<T, TQueryable>(this TQueryable query, bool condition, Expression<Func<T, bool>> predicate)

    where TQueryable : IQueryable<T>
Parameters
Type Name Description
TQueryable query

Queryable to apply filtering

System.Boolean condition

A boolean value

Expression<Func<T, System.Boolean>> predicate

Predicate to filter the query

Returns
Type Description
TQueryable

Filtered or not filtered query based on condition

Type Parameters
Name Description
T
TQueryable

WhereIf<T, TQueryable>(TQueryable, Boolean, Expression<Func<T, Int32, Boolean>>)

Filters a by given predicate if given condition is true.

Declaration
public static TQueryable WhereIf<T, TQueryable>(this TQueryable query, bool condition, Expression<Func<T, int, bool>> predicate)

    where TQueryable : IQueryable<T>
Parameters
Type Name Description
TQueryable query

Queryable to apply filtering

System.Boolean condition

A boolean value

Expression<Func<T, System.Int32, System.Boolean>> predicate

Predicate to filter the query

Returns
Type Description
TQueryable

Filtered or not filtered query based on condition

Type Parameters
Name Description
T
TQueryable
Back to top Powered by Volosoft