Table of Contents

Class NullsOrderingRenderer

Namespace
NextORM.Core
Assembly
nextorm.core.dll

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

expressionSql string

The rendered key SQL.

direction OrderDirection

The requested key direction.

nullsPosition NullsPosition

The explicit placement; Default is rejected.

Returns

string

The emulated ordering fragment.

Exceptions

ArgumentOutOfRangeException

nullsPosition is not First or Last.

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

expressionSql string

The rendered key SQL.

direction OrderDirection

The requested key direction.

nullsPosition NullsPosition

The explicit placement; Default is rejected.

Returns

string

The native ordering fragment.

Exceptions

ArgumentOutOfRangeException

nullsPosition is not First or Last.

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

nullsPosition NullsPosition

The placement to validate.

Returns

NullsPosition

The validated value.

Exceptions

ArgumentOutOfRangeException

The value is not a defined NullsPosition member.