Table of Contents

Class AggregateFunctionBuilder.AggregateModeBuilder

Namespace
LinqToDB.Linq.Translation
Assembly
linq2db.dll
public sealed class AggregateFunctionBuilder.AggregateModeBuilder : AggregateFunctionBuilder.AggregateModeBuilderBase<AggregateFunctionBuilder.AggregateModeBuilder>
Inheritance
object
AggregateFunctionBuilder.AggregateModeBuilder
Inherited Members
Extension Methods

Methods

IsServerSideOnly(bool)

Opt in to strict server-side translation. When called with true the aggregate raises an error expression on a translation failure regardless of the caller's isExpression flag. Default false = lenient: when the caller passes isExpression: true to Build(ITranslationContext, MethodCallExpression, bool) (the surrounding visitor is willing to partition the projection for client-side evaluation), the aggregate returns null instead of an error and the dispatch chain cascades to the partial-translation fallback. Use the strict opt-in for aggregates without a viable C# / BCL fallback body.

public AggregateFunctionBuilder.AggregateModeBuilder IsServerSideOnly(bool isServerSideOnly)

Parameters

isServerSideOnly bool

Returns

AggregateFunctionBuilder.AggregateModeBuilder

OnBuildFunction(Action<AggregateComposer>)

public AggregateFunctionBuilder.AggregateModeBuilder OnBuildFunction(Action<AggregateFunctionBuilder.AggregateComposer> build)

Parameters

build Action<AggregateFunctionBuilder.AggregateComposer>

Returns

AggregateFunctionBuilder.AggregateModeBuilder

TransformItems(Func<Expression, Expression>)

Plain mode only: transform each unpacked item LINQ-expression before SQL translation. Use to rewrite e.g. (object)guid args into guid.ToString() calls so they reach the type-specific translator instead of falling through to CAST AS VarChar. No-op in aggregate mode (the per-row column expression goes through TransformValue(Func<Expression, Expression>)).

public AggregateFunctionBuilder.AggregateModeBuilder TransformItems(Func<Expression, Expression> transformer)

Parameters

transformer Func<Expression, Expression>

Returns

AggregateFunctionBuilder.AggregateModeBuilder

TransformValue(Func<Expression, Expression>)

Aggregate mode only: transform the per-row value LINQ-expression before SQL translation. Same purpose as TransformItems(Func<Expression, Expression>) but for the column expression of an aggregate-over-grouping (e.g. g.Select(x => x.GuidCol) rewritten to g.Select(x => x.GuidCol.ToString())).

public AggregateFunctionBuilder.AggregateModeBuilder TransformValue(Func<Expression, Expression> transformer)

Parameters

transformer Func<Expression, Expression>

Returns

AggregateFunctionBuilder.AggregateModeBuilder

TranslateArguments(params int[])

public AggregateFunctionBuilder.AggregateModeBuilder TranslateArguments(params int[] indexes)

Parameters

indexes int[]

Returns

AggregateFunctionBuilder.AggregateModeBuilder