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
sourceEntityBuilder<TEntity>The builder the component is attached to.
valueSelectorExpression<Func<TEntity, TValue>>The value whose maximum is selected; a composite key is compared lexicographically.
tiesExtremeRowTiesWhether to keep one row or every row tied on the extreme value.
groupByExpression<Func<TEntity, object>>Optional grouping key;
nullselects across the whole source.
Returns
- EntityBuilder<TEntity>
The same query shape with the extreme-row component attached.
Type Parameters
TEntityThe mapped entity type.
TValueThe 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
sourceEntityBuilder<TEntity>The builder the component is attached to.
valueSelectorExpression<Func<TEntity, TValue>>The value whose maximum is selected.
projectionExpression<Func<TEntity, TResult>>The projection applied to each surviving row; it never participates in winner selection.
tiesExtremeRowTiesWhether to keep one row or every row tied on the extreme value.
groupByExpression<Func<TEntity, object>>Optional grouping key;
nullselects across the whole source.
Returns
- QueryCommand<TResult>
The projected query command.
Type Parameters
TEntityThe mapped entity type.
TValueThe value type compared for the extremum.
TResultThe 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
sourceEntityBuilder<TEntity>The builder the component is attached to.
valueSelectorExpression<Func<TEntity, TValue>>The value whose minimum is selected; a composite key is compared lexicographically.
tiesExtremeRowTiesWhether to keep one row or every row tied on the extreme value.
groupByExpression<Func<TEntity, object>>Optional grouping key;
nullselects across the whole source.
Returns
- EntityBuilder<TEntity>
The same query shape with the extreme-row component attached.
Type Parameters
TEntityThe mapped entity type.
TValueThe 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
sourceEntityBuilder<TEntity>The builder the component is attached to.
valueSelectorExpression<Func<TEntity, TValue>>The value whose minimum is selected.
projectionExpression<Func<TEntity, TResult>>The projection applied to each surviving row; it never participates in winner selection.
tiesExtremeRowTiesWhether to keep one row or every row tied on the extreme value.
groupByExpression<Func<TEntity, object>>Optional grouping key;
nullselects across the whole source.
Returns
- QueryCommand<TResult>
The projected query command.
Type Parameters
TEntityThe mapped entity type.
TValueThe value type compared for the extremum.
TResultThe projection result type.