Class TypeHelper
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
TypeType from generic definition.
replaced
TypeConcrete 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
MethodInfoarguments
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
MethodInfoarguments
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)