ExpressionExtensions
Holds the Expression extension methods.
Constructs a property access expression, => Expression.Property(expression, prop)
public static BlockExpression AsBlock(this IEnumerable<Expression> expressions, ParameterExpression[] variables)
Constructs a block expression from an expression collection and variables, => Expression.Block(variables, expressions)
Constructs a constant expression from an object, => Expression.Constant(obj)
Constructs a constant expression from an object and a type, => Expression.Constant(obj, type)
Constructs a default expression from a type, => Expression.Default(type)
public static LambdaExpression AsLambda(this Expression expression, ParameterExpression[] parameters)
Constructs a lambda expression from an expression and parameters, => Expression.Lambda(expression, parameters)
public static LambdaExpression AsLambda(this Expression expression, Type delegateType, IEnumerable<ParameterExpression> parameters)
Constructs a lambda expression from an expression and parameters, => Expression.Lambda(expression, parameters)
public static LambdaExpression AsLambda(this Expression expression, Type delegateType, ParameterExpression[] parameters)
Constructs a lambda expression from an expression and parameters, => Expression.Lambda(expression, parameters)
public static LambdaExpression AsLambda(this Expression expression, IEnumerable<ParameterExpression> parameters)
Constructs a lambda expression from an expression and parameters, => Expression.Lambda(expression, parameters)
public static Expression<TDelegate> AsLambda<TDelegate>(this Expression expression, ParameterExpression[] parameters)
Constructs a lambda expression from an expression and parameters, => Expression.Lambda{TDelegate}(expression, parameters)
Constructs a parameter expression from a type, => Expression.Parameter(type, name)
Constructs an assigment expression, => Expression.Assign(left, right)
Constructs an assigment expression, => Expression.Bind(member, expression)
Constructs a variable expression from a type, => Expression.Variable(type, name)
public static MethodCallExpression CallMethod(this Expression target, MethodInfo methodInfo, Expression[] parameters)
Constructs a method call expression from a target expression, method info and parameters, => Expression.Call(target, methodInfo, parameters)
public static MethodCallExpression CallMethod(this Expression target, MethodInfo methodInfo, IEnumerable<Expression> parameters)
Constructs a method call expression from a target expression, method info and parameters, => Expression.Call(target, methodInfo, parameters)
public static MethodCallExpression CallMethod(this MethodInfo methodInfo, Expression target, Expression[] parameters)
Constructs a method call expression from a target expression, method info and parameters, => Expression.Call(target, methodInfo, parameters)
public static MethodCallExpression CallMethod(this MethodInfo methodInfo, Expression target, IEnumerable<Expression> parameters)
Constructs a method call expression from a target expression, method info and parameters, => Expression.Call(target, methodInfo, parameters)
public static MethodCallExpression CallStaticMethod(this MethodInfo methodInfo, Expression[] parameters)
Constructs a static method call expression from a MethodInfo and its parameters, => Expression.Call(methodInfo, parameters)
public static MethodCallExpression CallStaticMethod(this MethodInfo methodInfo, IEnumerable<Expression> parameters)
Constructs a static method call expression from a MethodInfo and its parameters, => Expression.Call(methodInfo, parameters)
public static Func<IResolutionScope, IRequestContext, object> CompileDelegate(this Expression expression, ResolutionContext resolutionContext, ContainerConfiguration containerConfiguration)
Compiles a LambdaExpression to a Delegate. For testing purposes.
public static Func<IResolutionScope, IRequestContext, Delegate> CompileDynamicDelegate(this Expression expression, ResolutionContext resolutionContext, ContainerConfiguration containerConfiguration)
Compiles a lambda expression into a Func delegate.
Compiles a lambda expression into a Func delegate.
Constructs a convert expression, => Expression.Convert(expression, type)
public static MemberInitExpression InitMembers(this Expression expression, IEnumerable<MemberBinding> bindings)
Constructs a member init expression, => Expression.MemberInit(expression, bindings)
public static MemberInitExpression InitMembers(this Expression expression, MemberBinding[] bindings)
Constructs a member init expression, => Expression.MemberInit(expression, bindings)
Constructs a new array expression, => Expression.NewArrayInit(type, initializerExpressions)
public static NewArrayExpression InitNewArray(this Type type, IEnumerable<Expression> initializerExpressions)
Constructs a new array expression, => Expression.NewArrayInit(type, initializerExpressions)
Constructs an invocation expression, => Expression.Invoke(delegate.AsConstant(), parameters)
public static InvocationExpression InvokeDelegate(this Delegate delegate, IEnumerable<Expression> parameters)
Constructs an invocation expression, => Expression.Invoke(delegate.AsConstant(), parameters)
public static InvocationExpression InvokeLambda(this LambdaExpression expression, Expression[] parameters)
Constructs an invocation expression, => Expression.Invoke(expression, parameters)
public static NewExpression MakeNew(this ConstructorInfo constructor, IEnumerable<Expression> arguments)
Constructs an new expression, => Expression.New(constructor, arguments)
Constructs an new expression, => Expression.New(constructor, arguments)
Constructs a member access expression, => Expression.Property(expression, prop) or Expression.Field(expression, field)
Constructs a property access expression, => Expression.Property(expression, prop)