Class ExpressionHelpers
- Namespace
- LinqToDB.Internal.Expressions
- Assembly
- linq2db.dll
public static class ExpressionHelpers
- Inheritance
-
objectExpressionHelpers
Methods
CollectMembers(Expression)
public static IEnumerable<Expression> CollectMembers(Expression expr)
Parameters
exprExpression
Returns
EnsureObject(Expression)
public static Expression EnsureObject(Expression expr)
Parameters
exprExpression
Returns
MakeCall<TParam1, TResult>(Expression<Func<TParam1, TResult>>, Expression)
public static Expression MakeCall<TParam1, TResult>(Expression<Func<TParam1, TResult>> func, Expression param1)
Parameters
funcExpression<Func<TParam1, TResult>>param1Expression
Returns
Type Parameters
TParam1TResult
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
funcExpression<Func<TParam1, TParam2, TResult>>param1Expressionparam2Expression
Returns
Type Parameters
TParam1TParam2TResult
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
funcExpression<Func<TParam1, TParam2, TParam3, TResult>>param1Expressionparam2Expressionparam3Expression
Returns
Type Parameters
TParam1TParam2TParam3TResult
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
expressionExpressionbuildFunc<Expression, Expression>
Returns
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.