Table of Contents

Class SelectGroupExtensions

Namespace
NextORM.Extensions
Assembly
nextorm.extensions.dll

The grouping operators of the nextorm.extensions package: SelectGroup and SelectGroupHaving, both built on the public query-component contract.

public static class SelectGroupExtensions
Inheritance
SelectGroupExtensions
Inherited Members

Methods

SelectGroupHaving<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult>>, Expression<Func<TResult, bool>>)

Same inference as SelectGroup<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult>>), with condition AND-ed into the effective HAVING. The condition is typed on the projection result (TResult), never on the source entity: a member of the result stands for the projection expression that produces it, so f => f.Total > 5 becomes the same HAVING as the underlying sum(...) > 5. Keys are inferred only from projection; the condition never adds a key.

public static QueryCommand<TResult> SelectGroupHaving<TEntity, TResult>(this EntityBuilder<TEntity> source, Expression<Func<TEntity, TResult>> projection, Expression<Func<TResult, bool>> condition)

Parameters

source EntityBuilder<TEntity>

The entity builder to group.

projection Expression<Func<TEntity, TResult>>

The same projection lambda Select takes.

condition Expression<Func<TResult, bool>>

A HAVING predicate over the projection result, AND-ed with any existing source Having.

Returns

QueryCommand<TResult>

A typed command for the grouped projection.

Type Parameters

TEntity

The mapped source entity.

TResult

The shape of the projection.

Exceptions

ArgumentNullException

projection or condition is null.

QueryPreparationException

The command already carries explicit grouping, the projection contains a window function or a subquery, the condition references a member the projection does not bind (or the result as a whole), or a row member of the projection or of the effective HAVING is not covered by an inferred key.

NotSupportedException

The command targets the in-memory provider.

SelectGroup<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult>>)

Projects each group of source, inferring the GROUP BY keys from projection: every aggregate-free, row-dependent subexpression becomes a key and the aggregate calls fold each group. The projection keeps its exact shape — no client-side grouping and no rewriting of its members.

public static QueryCommand<TResult> SelectGroup<TEntity, TResult>(this EntityBuilder<TEntity> source, Expression<Func<TEntity, TResult>> projection)

Parameters

source EntityBuilder<TEntity>

The entity builder to group.

projection Expression<Func<TEntity, TResult>>

The same projection lambda Select takes.

Returns

QueryCommand<TResult>

A typed command for the grouped projection.

Type Parameters

TEntity

The mapped source entity.

TResult

The shape of the projection.

Exceptions

ArgumentNullException

projection is null.

QueryPreparationException

The command already carries explicit grouping, the projection contains a window function or a subquery, or a Having/expression OrderBy member is not covered by an inferred key.

NotSupportedException

The command targets the in-memory provider.