Table of Contents

Class ExpressionEvaluator

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

Methods

EvaluateExpression(Expression?)

public static object? EvaluateExpression(this Expression? expr)

Parameters

expr Expression

Returns

object

EvaluateExpression<T>(Expression?)

public static T? EvaluateExpression<T>(this Expression? expr) where T : class

Parameters

expr Expression

Returns

T

Type Parameters

T

TryEvaluateCapturedValue(Expression, out object?)

Reads the value of a captured variable - a chain of field reads over a constant, or a static field - without running any getter or method. Reading a static field runs its type's static constructor if it has not run yet.

public static bool TryEvaluateCapturedValue(this Expression expr, out object? value)

Parameters

expr Expression

Expression to read.

value object

The value read, when the method returns true.

Returns

bool

false when expr is anything other than such a chain, or a link of the chain is null.