Class QueryableExtensions
Defines a collection of extensions for Entity Framework queries.
Inheritance
System.Object
QueryableExtensions
Namespace: MADE.Data.EFCore.Extensions
Assembly: MADE.Data.EFCore.dll
Syntax
public static class QueryableExtensions : object
Methods
| Improve this Doc View SourceOrderBy<T>(IQueryable<T>, String, Boolean)
Orders the query results by the specified property name from the entity with the option for order by ascending or descending.
Declaration
public static IQueryable<T> OrderBy<T>(this IQueryable<T> query, string sortName, bool sortDesc)
Parameters
Type | Name | Description |
---|---|---|
IQueryable<T> | query | The query to order. |
System.String | sortName | The property/column name to sort on for the entity. |
System.Boolean | sortDesc | A value indicating whether to sort descending. |
Returns
Type | Description |
---|---|
IQueryable<T> | The ordered query. |
Type Parameters
Name | Description |
---|---|
T | The type of entity being ordered. |
Page<T>(IQueryable<T>, Int32, Int32)
Skips and takes a subset of a data query based on the specified current page and page size requested.
Declaration
public static IQueryable<T> Page<T>(this IQueryable<T> query, int page, int pageSize)
Parameters
Type | Name | Description |
---|---|---|
IQueryable<T> | query | The current query. |
System.Int32 | page | The current page being requested. |
System.Int32 | pageSize | The size of the page being requested. |
Returns
Type | Description |
---|---|
IQueryable<T> | The paginated query. |
Type Parameters
Name | Description |
---|---|
T | The type of entity being queried. |