Class Ordering
Represents ordering information.
Inheritance
Namespace: Umbraco.Cms.Core.Services
Assembly: Umbraco.Core.dll
Syntax
public class Ordering
Constructors
View SourceOrdering(String, Direction, String, Boolean)
Initializes a new instance of the Ordering class.
Declaration
public Ordering(string orderBy, Direction direction = Direction.Ascending, string culture = null, bool isCustomField = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | orderBy | The name of the ordering field. |
Direction | direction | The ordering direction. |
System.String | culture | The (ISO) culture to consider when sorting multi-lingual fields. |
System.Boolean | isCustomField | A value indicating whether the ordering field is a custom user property. |
Remarks
The orderBy
can be null, meaning: not sorting. If it is the empty string, it becomes
null.
The culture
can be the empty string, meaning: invariant. If it is null, it becomes the
empty string.
Properties
View SourceCulture
Gets (ISO) culture to consider when sorting multi-lingual fields.
Declaration
public string Culture { get; }
Property Value
Type | Description |
---|---|
System.String |
Direction
Gets the ordering direction.
Declaration
public Direction Direction { get; }
Property Value
Type | Description |
---|---|
Direction |
IsCustomField
Gets a value indicating whether the ordering field is a custom user property.
Declaration
public bool IsCustomField { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsEmpty
Gets a value indicating whether this ordering is the default ordering.
Declaration
public bool IsEmpty { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsInvariant
Gets a value indicating whether the culture of this ordering is invariant.
Declaration
public bool IsInvariant { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
OrderBy
Gets the name of the ordering field.
Declaration
public string OrderBy { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
View SourceBy(String, Direction, String, Boolean)
Creates a new instance of the Ordering class.
Declaration
public static Ordering By(string orderBy, Direction direction = Direction.Ascending, string culture = null, bool isCustomField = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | orderBy | The name of the ordering field. |
Direction | direction | The ordering direction. |
System.String | culture | The (ISO) culture to consider when sorting multi-lingual fields. |
System.Boolean | isCustomField | A value indicating whether the ordering field is a custom user property. |
Returns
Type | Description |
---|---|
Ordering |
Remarks
The orderBy
can be null, meaning: not sorting. If it is the empty string, it becomes
null.
The culture
can be the empty string, meaning: invariant. If it is null, it becomes the
empty string.
ByDefault()
Gets the default Ordering instance.
Declaration
public static Ordering ByDefault()
Returns
Type | Description |
---|---|
Ordering |