Class NullsOrderingRenderer
Renders an ORDER BY key with an explicit NULL placement, and validates placement values that
reach rendering or execution. Kept out of ISqlDialect so the default interface
implementation stays a one-line delegation and the CASE emulation oracle lives in one place.
public static class NullsOrderingRenderer
- Inheritance
-
NullsOrderingRenderer
- Inherited Members
Methods
Render(string, OrderDirection, NullsPosition)
Emulates an explicit NULL placement with a CASE rank key followed by the key itself.
expressionSql is the already-qualified/quoted key SQL, so a parameterized key
occurs twice in the returned fragment and both occurrences must be bound. The rank prefix is
always ascending — including for a descending key — and only the key carries the requested
direction. The returned text is one logical ordering item even though it contains two sort keys.
public static string Render(string expressionSql, OrderDirection direction, NullsPosition nullsPosition)
Parameters
expressionSqlstringThe rendered key SQL.
directionOrderDirectionThe requested key direction.
nullsPositionNullsPositionThe explicit placement; Default is rejected.
Returns
- string
The emulated ordering fragment.
Exceptions
RenderNative(string, OrderDirection, NullsPosition)
Renders a placement with the provider's native NULLS FIRST/NULLS LAST syntax. The
key occurs once, so a parameterized key binds once.
public static string RenderNative(string expressionSql, OrderDirection direction, NullsPosition nullsPosition)
Parameters
expressionSqlstringThe rendered key SQL.
directionOrderDirectionThe requested key direction.
nullsPositionNullsPositionThe explicit placement; Default is rejected.
Returns
- string
The native ordering fragment.
Exceptions
Validate(NullsPosition)
Validates a placement value. Default is accepted because it means "provider default" and the callers handle it as the plain, unmodified ordering path.
public static NullsPosition Validate(NullsPosition nullsPosition)
Parameters
nullsPositionNullsPositionThe placement to validate.
Returns
- NullsPosition
The validated value.
Exceptions
- ArgumentOutOfRangeException
The value is not a defined NullsPosition member.