Table of Contents

Class TypeHelper

Namespace
LinqToDB.Common
Assembly
linq2db.dll
public static class TypeHelper
Inheritance
TypeHelper

Methods

EnumTypeRemapping(Type, Type, Type[])

Enumerates type transformation for generic arguments.

public static IEnumerable<Tuple<Type, Type>> EnumTypeRemapping(Type templateType, Type replaced, Type[] templateArguments)

Parameters

templateType Type

Type from generic definition.

replaced Type

Concrete type which needs mapping to generic definition.

templateArguments Type[]

Generic arguments of generic definition.

Returns

IEnumerable<Tuple<Type, Type>>

MakeGenericMethod(MethodInfo, Expression[])

Makes generic method based on type of arguments.

public static MethodInfo MakeGenericMethod(MethodInfo methodInfo, Expression[] arguments)

Parameters

methodInfo MethodInfo
arguments Expression[]

Returns

MethodInfo

New MethodCallExpression.

MakeMethodCall(MethodInfo, params Expression[])

Creates MethodCallExpression without specifying generic parameters.

public static MethodCallExpression MakeMethodCall(MethodInfo methodInfo, params Expression[] arguments)

Parameters

methodInfo MethodInfo
arguments Expression[]

Returns

MethodCallExpression

New MethodCallExpression.

RegisterTypeRemapping(Type, Type, Type[], Dictionary<Type, Type>)

Registers type transformation for generic arguments.

public static void RegisterTypeRemapping(Type templateType, Type replaced, Type[] templateArguments, Dictionary<Type, Type> typeMappings)

Parameters

templateType Type

Type from generic definition.

replaced Type

Concrete type which needs mapping to generic definition.

templateArguments Type[]

Generic arguments of generic definition.

typeMappings Dictionary<Type, Type>

Accumulator dictionary for registered mappings.