Table of Contents

Class ExpressionHelpers

Namespace
LinqToDB.Internal.Expressions
Assembly
linq2db.dll
public static class ExpressionHelpers
Inheritance
object
ExpressionHelpers

Methods

CollectMembers(Expression)

public static IEnumerable<Expression> CollectMembers(Expression expr)

Parameters

expr Expression

Returns

IEnumerable<Expression>

EnsureObject(Expression)

public static Expression EnsureObject(Expression expr)

Parameters

expr Expression

Returns

Expression

MakeCall<TParam1, TResult>(Expression<Func<TParam1, TResult>>, Expression)

public static Expression MakeCall<TParam1, TResult>(Expression<Func<TParam1, TResult>> func, Expression param1)

Parameters

func Expression<Func<TParam1, TResult>>
param1 Expression

Returns

Expression

Type Parameters

TParam1
TResult

MakeCall<TParam1, TParam2, TResult>(Expression<Func<TParam1, TParam2, TResult>>, Expression, Expression)

public static Expression MakeCall<TParam1, TParam2, TResult>(Expression<Func<TParam1, TParam2, TResult>> func, Expression param1, Expression param2)

Parameters

func Expression<Func<TParam1, TParam2, TResult>>
param1 Expression
param2 Expression

Returns

Expression

Type Parameters

TParam1
TParam2
TResult

MakeCall<TParam1, TParam2, TParam3, TResult>(Expression<Func<TParam1, TParam2, TParam3, TResult>>, Expression, Expression, Expression)

public static Expression MakeCall<TParam1, TParam2, TParam3, TResult>(Expression<Func<TParam1, TParam2, TParam3, TResult>> func, Expression param1, Expression param2, Expression param3)

Parameters

func Expression<Func<TParam1, TParam2, TParam3, TResult>>
param1 Expression
param2 Expression
param3 Expression

Returns

Expression

Type Parameters

TParam1
TParam2
TParam3
TResult

MoveValueMarkerOutside(Expression, Func<Expression, Expression>)

Moves a Sql.Constant or Sql.Parameter request outward through whatever build makes of its result.

public static Expression MoveValueMarkerOutside(Expression expression, Func<Expression, Expression> build)

Parameters

expression Expression
build Func<Expression, Expression>

Returns

Expression

Remarks

The request is written around the value the caller had in hand, but what a translator ends up sending is something made from it - a duration's tick count, a duration rounded down to whole seconds. Built inside the request, that work would leave the request wrapping an argument nothing reads any more, and the caller's choice of how the value should travel would be dropped in silence. Rewriting the request around the built value keeps it on what actually reaches the statement.

An expression carrying no such request is handed to build unchanged, so this is safe to apply whether or not one of the two is underneath.