Table of Contents

Class AggregateFunctionBuilder.AggregateComposer

Namespace
LinqToDB.Linq.Translation
Assembly
linq2db.dll
public sealed class AggregateFunctionBuilder.AggregateComposer
Inheritance
object
AggregateFunctionBuilder.AggregateComposer
Extension Methods

Constructors

AggregateComposer(ISqlExpressionFactory, AggregateBuildInfo, IAggregationContext)

public AggregateComposer(ISqlExpressionFactory factory, AggregateFunctionBuilder.AggregateBuildInfo buildInfo, IAggregationContext aggregationContext)

Parameters

factory ISqlExpressionFactory
buildInfo AggregateFunctionBuilder.AggregateBuildInfo
aggregationContext IAggregationContext

Properties

AggregationContext

public IAggregationContext AggregationContext { get; }

Property Value

IAggregationContext

BuildInfo

public AggregateFunctionBuilder.AggregateBuildInfo BuildInfo { get; }

Property Value

AggregateFunctionBuilder.AggregateBuildInfo

Error

public SqlErrorExpression? Error { get; }

Property Value

SqlErrorExpression

Factory

public ISqlExpressionFactory Factory { get; }

Property Value

ISqlExpressionFactory

Fallback

public Action<AggregateFunctionBuilder.AggregateFallbackModeBuilder>? Fallback { get; }

Property Value

Action<AggregateFunctionBuilder.AggregateFallbackModeBuilder>

MaterializationCheck

public Func<Expression, Expression>? MaterializationCheck { get; }

Property Value

Func<Expression, Expression>

Result

public ISqlExpression? Result { get; }

Property Value

ISqlExpression

SqlRewriter

public Func<SqlPlaceholderExpression, SqlPlaceholderExpression>? SqlRewriter { get; }

Property Value

Func<SqlPlaceholderExpression, SqlPlaceholderExpression>

Translator

public ISqlExpressionTranslator Translator { get; }

Property Value

ISqlExpressionTranslator

Methods

GetFilteredToNullValues(out ICollection<ISqlExpression>?, out SqlErrorExpression?)

public bool GetFilteredToNullValues(out ICollection<ISqlExpression>? values, out SqlErrorExpression? error)

Parameters

values ICollection<ISqlExpression>
error SqlErrorExpression

Returns

bool

SetError(SqlErrorExpression)

public void SetError(SqlErrorExpression error)

Parameters

error SqlErrorExpression

SetFallback(Action<AggregateFallbackModeBuilder>)

public void SetFallback(Action<AggregateFunctionBuilder.AggregateFallbackModeBuilder> fallback)

Parameters

fallback Action<AggregateFunctionBuilder.AggregateFallbackModeBuilder>

SetMaterializationCheck(Func<Expression, Expression>)

Register a runtime C# check (e.g. CheckNullValue) that wraps the materialized aggregate read. Used by non-nullable Min/Max/Avg, which throw on empty input per LINQ. Invoked by AggregateExecuteContext.MakeExpression when materializing.

public void SetMaterializationCheck(Func<Expression, Expression> check)

Parameters

check Func<Expression, Expression>

SetResult(ISqlExpression)

public void SetResult(ISqlExpression sql)

Parameters

sql ISqlExpression

SetSqlRewriter(Func<SqlPlaceholderExpression, SqlPlaceholderExpression>)

Register a SQL-side rewrite that runs at OUTER APPLY lift time, after UpdateNesting has promoted the inner aggregate to a parent-side column reference — or eagerly at construction for grouped aggregates. Used by non-nullable Sum / StringJoin family to wrap the lifted reference with COALESCE(<ref>, default). The bare aggregate stays in the inner SQL tree during provider validation/optimization.

public void SetSqlRewriter(Func<SqlPlaceholderExpression, SqlPlaceholderExpression> rewriter)

Parameters

rewriter Func<SqlPlaceholderExpression, SqlPlaceholderExpression>