Table of Contents

Class ExtremeRowExtensions

Namespace
NextORM.Extensions
Assembly
nextorm.extensions.dll

Extension methods that attach the nextorm.extensions extreme-row component: they keep the row(s) holding the smallest or greatest value, globally or per group, exactly like the built-in SelectWhereMin/SelectWhereMax but built entirely on the public query-component layer.

public static class ExtremeRowExtensions
Inheritance
ExtremeRowExtensions
Inherited Members

Methods

SelectWhereMax<TEntity, TValue>(EntityBuilder<TEntity>, Expression<Func<TEntity, TValue>>, ExtremeRowTies, Expression<Func<TEntity, object?>>?)

Keeps the row(s) with the greatest valueSelector value and returns the builder so the query can continue.

public static EntityBuilder<TEntity> SelectWhereMax<TEntity, TValue>(this EntityBuilder<TEntity> source, Expression<Func<TEntity, TValue>> valueSelector, ExtremeRowTies ties = ExtremeRowTies.One, Expression<Func<TEntity, object?>>? groupBy = null)

Parameters

source EntityBuilder<TEntity>

The builder the component is attached to.

valueSelector Expression<Func<TEntity, TValue>>

The value whose maximum is selected; a composite key is compared lexicographically.

ties ExtremeRowTies

Whether to keep one row or every row tied on the extreme value.

groupBy Expression<Func<TEntity, object>>

Optional grouping key; null selects across the whole source.

Returns

EntityBuilder<TEntity>

The same query shape with the extreme-row component attached.

Type Parameters

TEntity

The mapped entity type.

TValue

The value type compared for the extremum.

SelectWhereMax<TEntity, TValue, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TValue>>, Expression<Func<TEntity, TResult>>, ExtremeRowTies, Expression<Func<TEntity, object?>>?)

Keeps the row(s) with the greatest valueSelector value and applies projection to each surviving row.

public static QueryCommand<TResult> SelectWhereMax<TEntity, TValue, TResult>(this EntityBuilder<TEntity> source, Expression<Func<TEntity, TValue>> valueSelector, Expression<Func<TEntity, TResult>> projection, ExtremeRowTies ties = ExtremeRowTies.One, Expression<Func<TEntity, object?>>? groupBy = null)

Parameters

source EntityBuilder<TEntity>

The builder the component is attached to.

valueSelector Expression<Func<TEntity, TValue>>

The value whose maximum is selected.

projection Expression<Func<TEntity, TResult>>

The projection applied to each surviving row; it never participates in winner selection.

ties ExtremeRowTies

Whether to keep one row or every row tied on the extreme value.

groupBy Expression<Func<TEntity, object>>

Optional grouping key; null selects across the whole source.

Returns

QueryCommand<TResult>

The projected query command.

Type Parameters

TEntity

The mapped entity type.

TValue

The value type compared for the extremum.

TResult

The projection result type.

SelectWhereMin<TEntity, TValue>(EntityBuilder<TEntity>, Expression<Func<TEntity, TValue>>, ExtremeRowTies, Expression<Func<TEntity, object?>>?)

Keeps the row(s) with the smallest valueSelector value and returns the builder so the query can continue.

public static EntityBuilder<TEntity> SelectWhereMin<TEntity, TValue>(this EntityBuilder<TEntity> source, Expression<Func<TEntity, TValue>> valueSelector, ExtremeRowTies ties = ExtremeRowTies.One, Expression<Func<TEntity, object?>>? groupBy = null)

Parameters

source EntityBuilder<TEntity>

The builder the component is attached to.

valueSelector Expression<Func<TEntity, TValue>>

The value whose minimum is selected; a composite key is compared lexicographically.

ties ExtremeRowTies

Whether to keep one row or every row tied on the extreme value.

groupBy Expression<Func<TEntity, object>>

Optional grouping key; null selects across the whole source.

Returns

EntityBuilder<TEntity>

The same query shape with the extreme-row component attached.

Type Parameters

TEntity

The mapped entity type.

TValue

The value type compared for the extremum.

SelectWhereMin<TEntity, TValue, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TValue>>, Expression<Func<TEntity, TResult>>, ExtremeRowTies, Expression<Func<TEntity, object?>>?)

Keeps the row(s) with the smallest valueSelector value and applies projection to each surviving row.

public static QueryCommand<TResult> SelectWhereMin<TEntity, TValue, TResult>(this EntityBuilder<TEntity> source, Expression<Func<TEntity, TValue>> valueSelector, Expression<Func<TEntity, TResult>> projection, ExtremeRowTies ties = ExtremeRowTies.One, Expression<Func<TEntity, object?>>? groupBy = null)

Parameters

source EntityBuilder<TEntity>

The builder the component is attached to.

valueSelector Expression<Func<TEntity, TValue>>

The value whose minimum is selected.

projection Expression<Func<TEntity, TResult>>

The projection applied to each surviving row; it never participates in winner selection.

ties ExtremeRowTies

Whether to keep one row or every row tied on the extreme value.

groupBy Expression<Func<TEntity, object>>

Optional grouping key; null selects across the whole source.

Returns

QueryCommand<TResult>

The projected query command.

Type Parameters

TEntity

The mapped entity type.

TValue

The value type compared for the extremum.

TResult

The projection result type.