Show / Hide Table of Contents

Class OrderBy

The OrderBy-class.

Inheritance
Object
OrderBy
Implements
ICloneable
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: SuperOffice.Data.SQL
Assembly: SoDataBase.dll
Syntax
public sealed class OrderBy : ICloneable

Constructors

OrderBy()

Initializes a new instance of the OrderBy class.

Declaration
public OrderBy()

OrderBy(Argument)

Initialize a new instance of the OrderBy class, and add the given argument as the first orderby, with ascending order.

Declaration
public OrderBy(Argument arg)
Parameters
Type Name Description
Argument arg

Argument to order by

OrderBy(Argument, OrderBySortType)

Initialize a new instance of the OrderBy class, and add the given argument as the first orderby, with the given order.

Declaration
public OrderBy(Argument arg, OrderBySortType type)
Parameters
Type Name Description
Argument arg

Argument to order by

OrderBySortType type

Ascending/descending

Properties

Argument

Returns the FieldInfo-collection

Declaration
public ICollection Argument { get; }
Property Value
Type Description
ICollection

The argument.

Count

Gets number of OrderBy

Declaration
public int Count { get; }
Property Value
Type Description
Int32

SortOrder

Get-method for the OrderBy-collection.

Declaration
public Dictionary<Argument, OrderBySortType> SortOrder { get; }
Property Value
Type Description
Dictionary<Argument, OrderBySortType>

Methods

Add(Argument)

Will add the in-parameter to the OrderBy collection. Default sort order is ascending.

Declaration
public void Add(Argument arg)
Parameters
Type Name Description
Argument arg

The argument to add to the collection

Exceptions
Type Condition
SoIllegalOperationException

Thrown if the argument is null, or is a Parameter with a zero length

Add(Argument, OrderBySortType)

Will add the in-parameter to the OrderBy collection. Sort-order will be set to the in-parameter sortOrder of type OrderBySortType.

Declaration
public void Add(Argument arg, OrderBySortType sortOrder)
Parameters
Type Name Description
Argument arg

The argument to add to the Collection.

OrderBySortType sortOrder

The sort order.

Exceptions
Type Condition
SoIllegalOperationException

Thrown if the argument is null, or is a Parameter with a zero length

Add(Argument, String)

Will add the in-argument to the OrderBy collection. Sort order will be set to the in-parameter sortOrder.

Declaration
public void Add(Argument arg, string sortOrder)
Parameters
Type Name Description
Argument arg

The argument to add to the collection.

String sortOrder

The sort order: "ASC" or "DESC". Other values will give an Ascending sort, not an exception

Exceptions
Type Condition
SoIllegalOperationException

Thrown if the argument is null, or is a Parameter with a zero length

Add(FieldInfo[])

Add an array of FieldInfo specifications to the OrderBy collection; sort order will be ascending

Declaration
public void Add(FieldInfo[] fields)
Parameters
Type Name Description
FieldInfo[] fields

Zero or more FieldInfo objects to add

Add(OrderBy)

Declaration
public void Add(OrderBy orderBy)
Parameters
Type Name Description
OrderBy orderBy

AggregationExist()

AggregationExist will check the OrderBy collection to see if it contains any Count-Arguments.

Declaration
public bool AggregationExist()
Returns
Type Description
Boolean

Returns true if the collection contains a Count-argument, else false.

Clear()

Clear the orderby collection/clause completely

Declaration
public void Clear()

Clone()

Return copy of the OrderBy clause.

Declaration
public object Clone()
Returns
Type Description
Object

Copy of the order-by sequence

Contains(Argument)

Declaration
public bool Contains(Argument arg)
Parameters
Type Name Description
Argument arg
Returns
Type Description
Boolean

GetNumberOfItems()

Gets the number of items in the OrderBy collection.

Declaration
public long GetNumberOfItems()
Returns
Type Description
Int64

ToString()

String output.

Declaration
public override string ToString()
Returns
Type Description
String

ORDER BY ...

Overrides
Object.ToString()

Implements

System.ICloneable

Extension Methods

EnumUtil.MapEnums<From, To>(From)
ObjectExtensions.AssignByReflection<T>(T, T)
ObjectExtensions.GraphCopy<T>(T)
Converters.MapEnums<From, To>(From)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top