Class OrderByFieldExtension
Lifted from: https://ronniediaz.com/2011/05/24/orderby-string-in-linq-c-net-dynamic-sorting-of-anonymous-types/
Inheritance
System.Object
OrderByFieldExtension
Namespace: LymeTemplateApi.Code.ExtensionMethods
Assembly: LymeTemplateApi.Code.dll
Syntax
public static class OrderByFieldExtension : object
Methods
OrderByField<T>(IQueryable<T>, String, Boolean)
Declaration
public static IQueryable<T> OrderByField<T>(this IQueryable<T> q, string SortField, bool Ascending)
Parameters
Type | Name | Description |
---|---|---|
IQueryable<T> | q | |
System.String | SortField | |
System.Boolean | Ascending |
Returns
Type | Description |
---|---|
IQueryable<T> |
Type Parameters
Name | Description |
---|---|
T |