Table of Contents

Class TypeMapper

Namespace
LinqToDB.Expressions
Assembly
linq2db.dll

Implements typed mappings support for dynamically loaded types.

public sealed class TypeMapper
Inheritance
TypeMapper
Extension Methods

Methods

BuildAction(LambdaExpression)

public Action BuildAction(LambdaExpression lambda)

Parameters

lambda LambdaExpression

Returns

Action

BuildAction<T>(LambdaExpression)

public Action<T> BuildAction<T>(LambdaExpression lambda)

Parameters

lambda LambdaExpression

Returns

Action<T>

Type Parameters

T

BuildAction<T1, T2>(LambdaExpression)

public Action<T1, T2> BuildAction<T1, T2>(LambdaExpression lambda)

Parameters

lambda LambdaExpression

Returns

Action<T1, T2>

Type Parameters

T1
T2

BuildAction<T1, T2, T3>(LambdaExpression)

public Action<T1, T2, T3> BuildAction<T1, T2, T3>(LambdaExpression lambda)

Parameters

lambda LambdaExpression

Returns

Action<T1, T2, T3>

Type Parameters

T1
T2
T3

BuildAction<T1, T2, T3, T4>(LambdaExpression)

public Action<T1, T2, T3, T4> BuildAction<T1, T2, T3, T4>(LambdaExpression lambda)

Parameters

lambda LambdaExpression

Returns

Action<T1, T2, T3, T4>

Type Parameters

T1
T2
T3
T4

BuildAction<T1, T2, T3, T4, T5>(LambdaExpression)

public Action<T1, T2, T3, T4, T5> BuildAction<T1, T2, T3, T4, T5>(LambdaExpression lambda)

Parameters

lambda LambdaExpression

Returns

Action<T1, T2, T3, T4, T5>

Type Parameters

T1
T2
T3
T4
T5

BuildFactory<TR>(Expression<Func<TR>>)

public Func<object> BuildFactory<TR>(Expression<Func<TR>> newFunc) where TR : TypeWrapper

Parameters

newFunc Expression<Func<TR>>

Returns

Func<object>

Type Parameters

TR

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

public Func<T, object> BuildFactory<T, TR>(Expression<Func<T, TR>> newFunc) where TR : TypeWrapper

Parameters

newFunc Expression<Func<T, TR>>

Returns

Func<T, object>

Type Parameters

T
TR

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

public Func<T1, T2, object> BuildFactory<T1, T2, TR>(Expression<Func<T1, T2, TR>> newFunc) where TR : TypeWrapper

Parameters

newFunc Expression<Func<T1, T2, TR>>

Returns

Func<T1, T2, object>

Type Parameters

T1
T2
TR

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

public Func<T1, T2, T3, object> BuildFactory<T1, T2, T3, TR>(Expression<Func<T1, T2, T3, TR>> newFunc) where TR : TypeWrapper

Parameters

newFunc Expression<Func<T1, T2, T3, TR>>

Returns

Func<T1, T2, T3, object>

Type Parameters

T1
T2
T3
TR

BuildFunc<TR>(LambdaExpression)

public Func<TR> BuildFunc<TR>(LambdaExpression lambda)

Parameters

lambda LambdaExpression

Returns

Func<TR>

Type Parameters

TR

BuildFunc<T, TR>(LambdaExpression)

public Func<T, TR> BuildFunc<T, TR>(LambdaExpression lambda)

Parameters

lambda LambdaExpression

Returns

Func<T, TR>

Type Parameters

T
TR

BuildFunc<T1, T2, TR>(LambdaExpression)

public Func<T1, T2, TR> BuildFunc<T1, T2, TR>(LambdaExpression lambda)

Parameters

lambda LambdaExpression

Returns

Func<T1, T2, TR>

Type Parameters

T1
T2
TR

BuildFunc<T1, T2, T3, TR>(LambdaExpression)

public Func<T1, T2, T3, TR> BuildFunc<T1, T2, T3, TR>(LambdaExpression lambda)

Parameters

lambda LambdaExpression

Returns

Func<T1, T2, T3, TR>

Type Parameters

T1
T2
T3
TR

BuildFunc<T1, T2, T3, T4, TR>(LambdaExpression)

public Func<T1, T2, T3, T4, TR> BuildFunc<T1, T2, T3, T4, TR>(LambdaExpression lambda)

Parameters

lambda LambdaExpression

Returns

Func<T1, T2, T3, T4, TR>

Type Parameters

T1
T2
T3
T4
TR

BuildFunc<T1, T2, T3, T4, T5, TR>(LambdaExpression)

public Func<T1, T2, T3, T4, T5, TR> BuildFunc<T1, T2, T3, T4, T5, TR>(LambdaExpression lambda)

Parameters

lambda LambdaExpression

Returns

Func<T1, T2, T3, T4, T5, TR>

Type Parameters

T1
T2
T3
T4
T5
TR

BuildFunc<T1, T2, T3, T4, T5, T6, TR>(LambdaExpression)

public Func<T1, T2, T3, T4, T5, T6, TR> BuildFunc<T1, T2, T3, T4, T5, T6, TR>(LambdaExpression lambda)

Parameters

lambda LambdaExpression

Returns

Func<T1, T2, T3, T4, T5, T6, TR>

Type Parameters

T1
T2
T3
T4
T5
T6
TR

BuildFunc<T1, T2, T3, T4, T5, T6, T7, TR>(LambdaExpression)

public Func<T1, T2, T3, T4, T5, T6, T7, TR> BuildFunc<T1, T2, T3, T4, T5, T6, T7, TR>(LambdaExpression lambda)

Parameters

lambda LambdaExpression

Returns

Func<T1, T2, T3, T4, T5, T6, T7, TR>

Type Parameters

T1
T2
T3
T4
T5
T6
T7
TR

BuildWrappedFactory<TR>(Expression<Func<TR>>)

public Func<TR> BuildWrappedFactory<TR>(Expression<Func<TR>> newFunc) where TR : TypeWrapper

Parameters

newFunc Expression<Func<TR>>

Returns

Func<TR>

Type Parameters

TR

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

public Func<T, TR> BuildWrappedFactory<T, TR>(Expression<Func<T, TR>> newFunc) where TR : TypeWrapper

Parameters

newFunc Expression<Func<T, TR>>

Returns

Func<T, TR>

Type Parameters

T
TR

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

public Func<T1, T2, TR> BuildWrappedFactory<T1, T2, TR>(Expression<Func<T1, T2, TR>> newFunc) where TR : TypeWrapper

Parameters

newFunc Expression<Func<T1, T2, TR>>

Returns

Func<T1, T2, TR>

Type Parameters

T1
T2
TR

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

public Func<T1, T2, T3, TR> BuildWrappedFactory<T1, T2, T3, TR>(Expression<Func<T1, T2, T3, TR>> newFunc) where TR : TypeWrapper

Parameters

newFunc Expression<Func<T1, T2, T3, TR>>

Returns

Func<T1, T2, T3, TR>

Type Parameters

T1
T2
T3
TR

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

public Func<T1, T2, T3, T4, TR> BuildWrappedFactory<T1, T2, T3, T4, TR>(Expression<Func<T1, T2, T3, T4, TR>> newFunc) where TR : TypeWrapper

Parameters

newFunc Expression<Func<T1, T2, T3, T4, TR>>

Returns

Func<T1, T2, T3, T4, TR>

Type Parameters

T1
T2
T3
T4
TR

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

public Func<T1, T2, T3, T4, T5, TR> BuildWrappedFactory<T1, T2, T3, T4, T5, TR>(Expression<Func<T1, T2, T3, T4, T5, TR>> newFunc) where TR : TypeWrapper

Parameters

newFunc Expression<Func<T1, T2, T3, T4, T5, TR>>

Returns

Func<T1, T2, T3, T4, T5, TR>

Type Parameters

T1
T2
T3
T4
T5
TR

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

public Func<T1, T2, T3, T4, T5, T6, TR> BuildWrappedFactory<T1, T2, T3, T4, T5, T6, TR>(Expression<Func<T1, T2, T3, T4, T5, T6, TR>> newFunc) where TR : TypeWrapper

Parameters

newFunc Expression<Func<T1, T2, T3, T4, T5, T6, TR>>

Returns

Func<T1, T2, T3, T4, T5, T6, TR>

Type Parameters

T1
T2
T3
T4
T5
T6
TR

FinalizeMappings()

public void FinalizeMappings()

MapAction(Expression<Action>)

public Expression MapAction(Expression<Action> action)

Parameters

action Expression<Action>

Returns

Expression

MapActionLambda(Expression<Action>)

public LambdaExpression MapActionLambda(Expression<Action> action)

Parameters

action Expression<Action>

Returns

LambdaExpression

MapActionLambda<T>(Expression<Action<T>>)

public LambdaExpression MapActionLambda<T>(Expression<Action<T>> action)

Parameters

action Expression<Action<T>>

Returns

LambdaExpression

Type Parameters

T

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

public LambdaExpression MapActionLambda<T1, T2>(Expression<Action<T1, T2>> action)

Parameters

action Expression<Action<T1, T2>>

Returns

LambdaExpression

Type Parameters

T1
T2

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

public LambdaExpression MapActionLambda<T1, T2, T3>(Expression<Action<T1, T2, T3>> action)

Parameters

action Expression<Action<T1, T2, T3>>

Returns

LambdaExpression

Type Parameters

T1
T2
T3

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

public LambdaExpression MapActionLambda<T1, T2, T3, T4>(Expression<Action<T1, T2, T3, T4>> action)

Parameters

action Expression<Action<T1, T2, T3, T4>>

Returns

LambdaExpression

Type Parameters

T1
T2
T3
T4

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

public LambdaExpression MapActionLambda<T1, T2, T3, T4, T5>(Expression<Action<T1, T2, T3, T4, T5>> action)

Parameters

action Expression<Action<T1, T2, T3, T4, T5>>

Returns

LambdaExpression

Type Parameters

T1
T2
T3
T4
T5

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

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

public LambdaExpression MapLambda<T, TR>(Expression<Func<T, TR>> func)

Parameters

func Expression<Func<T, TR>>

Returns

LambdaExpression

Type Parameters

T
TR

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

public LambdaExpression MapLambda<T1, T2, TR>(Expression<Func<T1, T2, TR>> func)

Parameters

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

Returns

LambdaExpression

Type Parameters

T1
T2
TR

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

public LambdaExpression MapLambda<T1, T2, T3, TR>(Expression<Func<T1, T2, T3, TR>> func)

Parameters

func Expression<Func<T1, T2, T3, TR>>

Returns

LambdaExpression

Type Parameters

T1
T2
T3
TR

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

public LambdaExpression MapLambda<T1, T2, T3, T4, TR>(Expression<Func<T1, T2, T3, T4, TR>> func)

Parameters

func Expression<Func<T1, T2, T3, T4, TR>>

Returns

LambdaExpression

Type Parameters

T1
T2
T3
T4
TR

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

public LambdaExpression MapLambda<T1, T2, T3, T4, T5, TR>(Expression<Func<T1, T2, T3, T4, T5, TR>> func)

Parameters

func Expression<Func<T1, T2, T3, T4, T5, TR>>

Returns

LambdaExpression

Type Parameters

T1
T2
T3
T4
T5
TR

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

public LambdaExpression MapLambda<T1, T2, T3, T4, T5, T6, TR>(Expression<Func<T1, T2, T3, T4, T5, T6, TR>> func)

Parameters

func Expression<Func<T1, T2, T3, T4, T5, T6, TR>>

Returns

LambdaExpression

Type Parameters

T1
T2
T3
T4
T5
T6
TR

MapLambda<T1, T2, T3, T4, T5, T6, T7, TR>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, TR>>)

public LambdaExpression MapLambda<T1, T2, T3, T4, T5, T6, T7, TR>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, TR>> func)

Parameters

func Expression<Func<T1, T2, T3, T4, T5, T6, T7, TR>>

Returns

LambdaExpression

Type Parameters

T1
T2
T3
T4
T5
T6
T7
TR

RegisterTypeWrapper(Type, Type)

public void RegisterTypeWrapper(Type wrapperType, Type originalType)

Parameters

wrapperType Type
originalType Type

RegisterTypeWrapper<TWrapper>(Type)

public void RegisterTypeWrapper<TWrapper>(Type originalType)

Parameters

originalType Type

Type Parameters

TWrapper

Type<T>()

public TypeMapper.TypeBuilder<T> Type<T>()

Returns

TypeMapper.TypeBuilder<T>

Type Parameters

T

WrapTask<TR>(Task, Type, CancellationToken)

public Task<TR?> WrapTask<TR>(Task instanceTask, Type instanceType, CancellationToken cancellationToken) where TR : TypeWrapper

Parameters

instanceTask Task
instanceType Type
cancellationToken CancellationToken

Returns

Task<TR>

Type Parameters

TR

Wrap<TR>(object?)

public TR? Wrap<TR>(object? instance) where TR : TypeWrapper

Parameters

instance object

Returns

TR

Type Parameters

TR