Table of Contents

Class ExpressionGenerator

Namespace
LinqToDB.Expressions
Assembly
linq2db.dll
public class ExpressionGenerator
Inheritance
ExpressionGenerator
Extension Methods

Constructors

ExpressionGenerator()

public ExpressionGenerator()

ExpressionGenerator(TypeMapper)

public ExpressionGenerator(TypeMapper mapper)

Parameters

mapper TypeMapper

Properties

ResultExpression

public Expression ResultExpression { get; }

Property Value

Expression

Methods

AddExpression(Expression)

public Expression AddExpression(Expression expression)

Parameters

expression Expression

Returns

Expression

AddVariable(ParameterExpression)

public ParameterExpression AddVariable(ParameterExpression variable)

Parameters

variable ParameterExpression

Returns

ParameterExpression

Assign(Expression, Expression)

public Expression Assign(Expression left, Expression right)

Parameters

left Expression
right Expression

Returns

Expression

AssignToVariable(Expression, string?)

public ParameterExpression AssignToVariable(Expression expression, string? name = null)

Parameters

expression Expression
name string

Returns

ParameterExpression

Build()

public Expression Build()

Returns

Expression

Build(Action<ExpressionGenerator>, TypeMapper?)

public static Expression Build(Action<ExpressionGenerator> buildFunc, TypeMapper? typeMapper = null)

Parameters

buildFunc Action<ExpressionGenerator>
typeMapper TypeMapper

Returns

Expression

Condition(Expression, Expression, Expression)

public Expression Condition(Expression test, Expression ifTrue, Expression ifFalse)

Parameters

test Expression
ifTrue Expression
ifFalse Expression

Returns

Expression

DeclareVariable(Type, string?)

public ParameterExpression DeclareVariable(Type type, string? name = null)

Parameters

type Type
name string

Returns

ParameterExpression

IfThen(Expression, Expression)

public Expression IfThen(Expression test, Expression ifTrue)

Parameters

test Expression
ifTrue Expression

Returns

Expression

IfThenElse(Expression, Expression, Expression)

public Expression IfThenElse(Expression test, Expression ifTrue, Expression ifFalse)

Parameters

test Expression
ifTrue Expression
ifFalse Expression

Returns

Expression

MapAction(Expression<Action>)

public Expression MapAction(Expression<Action> action)

Parameters

action Expression<Action>

Returns

Expression

MapAction<T>(Expression<Action<T>>, Expression)

public Expression MapAction<T>(Expression<Action<T>> action, Expression p)

Parameters

action Expression<Action<T>>
p Expression

Returns

Expression

Type Parameters

T

MapAction<T1, T2>(Expression<Action<T1, T2>>, Expression, Expression)

public Expression MapAction<T1, T2>(Expression<Action<T1, T2>> action, Expression p1, Expression p2)

Parameters

action Expression<Action<T1, T2>>
p1 Expression
p2 Expression

Returns

Expression

Type Parameters

T1
T2

MapAction<T1, T2, T3>(Expression<Action<T1, T2, T3>>, Expression, Expression, Expression)

public Expression MapAction<T1, T2, T3>(Expression<Action<T1, T2, T3>> action, Expression p1, Expression p2, Expression p3)

Parameters

action Expression<Action<T1, T2, T3>>
p1 Expression
p2 Expression
p3 Expression

Returns

Expression

Type Parameters

T1
T2
T3

MapAction<T1, T2, T3, T4>(Expression<Action<T1, T2, T3, T4>>, Expression, Expression, Expression, Expression)

public Expression MapAction<T1, T2, T3, T4>(Expression<Action<T1, T2, T3, T4>> action, Expression p1, Expression p2, Expression p3, Expression p4)

Parameters

action Expression<Action<T1, T2, T3, T4>>
p1 Expression
p2 Expression
p3 Expression
p4 Expression

Returns

Expression

Type Parameters

T1
T2
T3
T4

MapAction<T1, T2, T3, T4, T5>(Expression<Action<T1, T2, T3, T4, T5>>, Expression, Expression, Expression, Expression, Expression)

public Expression MapAction<T1, T2, T3, T4, T5>(Expression<Action<T1, T2, T3, T4, T5>> action, Expression p1, Expression p2, Expression p3, Expression p4, Expression p5)

Parameters

action Expression<Action<T1, T2, T3, T4, T5>>
p1 Expression
p2 Expression
p3 Expression
p4 Expression
p5 Expression

Returns

Expression

Type Parameters

T1
T2
T3
T4
T5

MapExpression<TR>(Expression<Func<TR>>)

public Expression MapExpression<TR>(Expression<Func<TR>> func)

Parameters

func Expression<Func<TR>>

Returns

Expression

Type Parameters

TR

MapExpression<T, TR>(Expression<Func<T, TR>>, Expression)

public Expression MapExpression<T, TR>(Expression<Func<T, TR>> func, Expression p)

Parameters

func Expression<Func<T, TR>>
p Expression

Returns

Expression

Type Parameters

T
TR

MapExpression<T1, T2, TR>(Expression<Func<T1, T2, TR>>, Expression, Expression)

public Expression MapExpression<T1, T2, TR>(Expression<Func<T1, T2, TR>> func, Expression p1, Expression p2)

Parameters

func Expression<Func<T1, T2, TR>>
p1 Expression
p2 Expression

Returns

Expression

Type Parameters

T1
T2
TR

MapExpression<T1, T2, T3, TR>(Expression<Func<T1, T2, T3, TR>>, Expression, Expression, Expression)

public Expression MapExpression<T1, T2, T3, TR>(Expression<Func<T1, T2, T3, TR>> func, Expression p1, Expression p2, Expression p3)

Parameters

func Expression<Func<T1, T2, T3, TR>>
p1 Expression
p2 Expression
p3 Expression

Returns

Expression

Type Parameters

T1
T2
T3
TR

MapExpression<T1, T2, T3, T4, TR>(Expression<Func<T1, T2, T3, T4, TR>>, Expression, Expression, Expression, Expression)

public Expression MapExpression<T1, T2, T3, T4, TR>(Expression<Func<T1, T2, T3, T4, TR>> func, Expression p1, Expression p2, Expression p3, Expression p4)

Parameters

func Expression<Func<T1, T2, T3, T4, TR>>
p1 Expression
p2 Expression
p3 Expression
p4 Expression

Returns

Expression

Type Parameters

T1
T2
T3
T4
TR

MapExpression<T1, T2, T3, T4, T5, TR>(Expression<Func<T1, T2, T3, T4, T5, TR>>, Expression, Expression, Expression, Expression, Expression)

public Expression MapExpression<T1, T2, T3, T4, T5, TR>(Expression<Func<T1, T2, T3, T4, T5, TR>> func, Expression p1, Expression p2, Expression p3, Expression p4, Expression p5)

Parameters

func Expression<Func<T1, T2, T3, T4, T5, TR>>
p1 Expression
p2 Expression
p3 Expression
p4 Expression
p5 Expression

Returns

Expression

Type Parameters

T1
T2
T3
T4
T5
TR

MemberAccess<T>(Expression<Func<T, object>>, Expression)

public MemberExpression MemberAccess<T>(Expression<Func<T, object>> memberExpression, Expression obj)

Parameters

memberExpression Expression<Func<T, object>>
obj Expression

Returns

MemberExpression

Type Parameters

T

Throw(Expression)

public Expression Throw(Expression expression)

Parameters

expression Expression

Returns

Expression

TryCatch(Expression, params CatchBlock[])

public Expression TryCatch(Expression body, params CatchBlock[] catchBlocks)

Parameters

body Expression
catchBlocks CatchBlock[]

Returns

Expression