Class QueryableSort
Contains information on a property and direction to use to sort a collection of items
Inheritance
Inherited Members
Namespace: LemonEdge.Utils
Assembly: Utils.dll
Syntax
[DataContract]
public class QueryableSort
Constructors
QueryableSort(String, Order)
Creates a new QueryableSort specifying to sort a collection of items using the specified propertyName
and sortDirection
Declaration
public QueryableSort(string propertyName, Order sortDirection)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyName | The property name to sort a collection of items by |
Order | sortDirection | The direction to sort the set of items in against the values of the specified property name |
Properties
PropertyName
The name of the property on each item to sort by
Declaration
public string PropertyName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
SortDirection
The direction to sort items in the collection by
Declaration
public Order SortDirection { get; set; }
Property Value
Type | Description |
---|---|
Order |
Methods
ParseSort(String, Func<String, String>)
Creates a new set of QueryableSorts from a text string in the form PropName SortDirection, PropName2 SortDirection2, ...
Declaration
public static IEnumerable<QueryableSort> ParseSort(string orderByClause, Func<string, string> translatePropertyName = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | orderByClause | A string containing the method of ordering items in the form PropName SortDirection, PropName2 SortDirection2, ... |
System.Func<System.String, System.String> | translatePropertyName | An optional function to translate property names from an old property name into a new one |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<QueryableSort> | Creates a set of QueryableSorts for each PropName SortDirection set |
ToString()
Provides a user friendly string of the sort direction of the form PropertyName SortDirection
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A user friendly string of the sort direction of the form PropertyName SortDirection |