Table of Contents

Struct Sorting

Namespace
NextORM.Core
Assembly
nextorm.core.dll

A single ORDER BY key: an expression or a resolved column index together with its direction.

public struct Sorting
Inherited Members
Extension Methods

Remarks

Was a struct with public mutable fields; Direction and PreparedExpression are now properties (with private backing fields). See docs/specs/design/API-NAMING-REVIEW.md findings P1-17 and P2-19.

Constructors

Sorting(int)

Initializes a sort key from an already-resolved result-set column index.

public Sorting(int columnIdx)

Parameters

columnIdx int

The zero-based column index.

Sorting(int, NullsPosition)

Initializes a sort key from an already-resolved result-set column index, with an explicit NULL placement.

public Sorting(int columnIdx, NullsPosition nullsPosition)

Parameters

columnIdx int

The zero-based column index.

nullsPosition NullsPosition

Where SQL NULL values are placed for this key.

Exceptions

ArgumentOutOfRangeException

nullsPosition is not a defined NullsPosition member.

Sorting(Expression)

Initializes a sort key from an expression that is translated during preparation.

public Sorting(Expression expression)

Parameters

expression Expression

The ORDER BY key expression.

Sorting(Expression, NullsPosition)

Initializes a sort key from an expression that is translated during preparation, with an explicit NULL placement.

public Sorting(Expression expression, NullsPosition nullsPosition)

Parameters

expression Expression

The ORDER BY key expression.

nullsPosition NullsPosition

Where SQL NULL values are placed for this key.

Exceptions

ArgumentOutOfRangeException

nullsPosition is not a defined NullsPosition member.

Properties

ColumnIndex

The resolved result-set column index, or null when the key is an expression.

public readonly int? ColumnIndex { get; }

Property Value

int?

Direction

Ascending or descending.

public OrderDirection Direction { readonly get; set; }

Property Value

OrderDirection

NullsPosition

Where SQL NULL values are placed for this key. Default emits no clause and keeps the provider default; it is the value produced by the constructor overloads that do not take a placement.

public NullsPosition NullsPosition { readonly get; set; }

Property Value

NullsPosition

Exceptions

ArgumentOutOfRangeException

The assigned value is not a defined NullsPosition member.

PreparedExpression

The ORDER BY key after translation (column index, parameter, ...). Populated by the query preparer; null until then.

public Expression? PreparedExpression { readonly get; set; }

Property Value

Expression

SortExpression

The original ORDER BY expression, or null when the key is a column index.

public readonly Expression? SortExpression { get; }

Property Value

Expression