Class AggregateFunctionBuilder.AggregateComposer
- Namespace
- LinqToDB.Linq.Translation
- Assembly
- linq2db.dll
public sealed class AggregateFunctionBuilder.AggregateComposer
- Inheritance
-
objectAggregateFunctionBuilder.AggregateComposer
- Extension Methods
Constructors
AggregateComposer(ISqlExpressionFactory, AggregateBuildInfo, IAggregationContext)
public AggregateComposer(ISqlExpressionFactory factory, AggregateFunctionBuilder.AggregateBuildInfo buildInfo, IAggregationContext aggregationContext)
Parameters
factoryISqlExpressionFactorybuildInfoAggregateFunctionBuilder.AggregateBuildInfoaggregationContextIAggregationContext
Properties
AggregationContext
public IAggregationContext AggregationContext { get; }
Property Value
BuildInfo
public AggregateFunctionBuilder.AggregateBuildInfo BuildInfo { get; }
Property Value
Error
public SqlErrorExpression? Error { get; }
Property Value
Factory
public ISqlExpressionFactory Factory { get; }
Property Value
Fallback
public Action<AggregateFunctionBuilder.AggregateFallbackModeBuilder>? Fallback { get; }
Property Value
MaterializationCheck
public Func<Expression, Expression>? MaterializationCheck { get; }
Property Value
Result
public ISqlExpression? Result { get; }
Property Value
SqlRewriter
public Func<SqlPlaceholderExpression, SqlPlaceholderExpression>? SqlRewriter { get; }
Property Value
Translator
public ISqlExpressionTranslator Translator { get; }
Property Value
Methods
GetFilteredToNullValues(out ICollection<ISqlExpression>?, out SqlErrorExpression?)
public bool GetFilteredToNullValues(out ICollection<ISqlExpression>? values, out SqlErrorExpression? error)
Parameters
valuesICollection<ISqlExpression>errorSqlErrorExpression
Returns
SetError(SqlErrorExpression)
public void SetError(SqlErrorExpression error)
Parameters
errorSqlErrorExpression
SetFallback(Action<AggregateFallbackModeBuilder>)
public void SetFallback(Action<AggregateFunctionBuilder.AggregateFallbackModeBuilder> fallback)
Parameters
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
checkFunc<Expression, Expression>
SetResult(ISqlExpression)
public void SetResult(ISqlExpression sql)
Parameters
sqlISqlExpression
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
rewriterFunc<SqlPlaceholderExpression, SqlPlaceholderExpression>