Class OrderBy
The OrderBy-class.
Implements
Inherited Members
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 |
---|---|
int |
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)
The OrderBy-class.
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 |
---|---|
bool | 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)
The OrderBy-class.
Declaration
public bool Contains(Argument arg)
Parameters
Type | Name | Description |
---|---|---|
Argument | arg |
Returns
Type | Description |
---|---|
bool |
GetNumberOfItems()
Gets the number of items in the OrderBy collection.
Declaration
public long GetNumberOfItems()
Returns
Type | Description |
---|---|
long |
ToString()
String output.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | ORDER BY ... |