Expression.MakeUnary 方法

定义

通过调用适当的工厂方法来创建一个 UnaryExpressionCreates a UnaryExpression by calling the appropriate factory method.

重载

MakeUnary(ExpressionType, Expression, Type)

在给定操作数的情况下,通过调用适当的工厂方法来创建一个 UnaryExpressionCreates a UnaryExpression, given an operand, by calling the appropriate factory method.

MakeUnary(ExpressionType, Expression, Type, MethodInfo)

在给定操作数和实现方法的情况下,通过调用适当的工厂方法来创建一个 UnaryExpressionCreates a UnaryExpression, given an operand and implementing method, by calling the appropriate factory method.

MakeUnary(ExpressionType, Expression, Type)

在给定操作数的情况下,通过调用适当的工厂方法来创建一个 UnaryExpressionCreates a UnaryExpression, given an operand, by calling the appropriate factory method.

public:
 static System::Linq::Expressions::UnaryExpression ^ MakeUnary(System::Linq::Expressions::ExpressionType unaryType, System::Linq::Expressions::Expression ^ operand, Type ^ type);
public static System.Linq.Expressions.UnaryExpression MakeUnary (System.Linq.Expressions.ExpressionType unaryType, System.Linq.Expressions.Expression operand, Type type);
static member MakeUnary : System.Linq.Expressions.ExpressionType * System.Linq.Expressions.Expression * Type -> System.Linq.Expressions.UnaryExpression
Public Shared Function MakeUnary (unaryType As ExpressionType, operand As Expression, type As Type) As UnaryExpression

参数

unaryType
ExpressionType

指定一元运算类型的 ExpressionTypeThe ExpressionType that specifies the type of unary operation.

operand
Expression

一个表示操作数的 ExpressionAn Expression that represents the operand.

type
Type

指定转换的目标类型的 Type(如果不适用,则传递 null)。The Type that specifies the type to be converted to (pass null if not applicable).

返回

UnaryExpression

通过调用适当的工厂方法生成的 UnaryExpressionThe UnaryExpression that results from calling the appropriate factory method.

例外

operandnulloperand is null.

unaryType 与一元表达式节点不对应。unaryType does not correspond to a unary expression node.

注解

unaryType参数确定 UnaryExpression 此方法调用的工厂方法。The unaryType parameter determines which UnaryExpression factory method this method calls. 例如,如果 unaryType 等于 Convert ,则此方法将调用 ConvertFor example, if unaryType is equal to Convert, this method invokes Convert. type如果参数不适用于调用的工厂方法,则将其忽略。The typeparameter is ignored if it does not apply to the factory method that is called.

适用于

MakeUnary(ExpressionType, Expression, Type, MethodInfo)

在给定操作数和实现方法的情况下,通过调用适当的工厂方法来创建一个 UnaryExpressionCreates a UnaryExpression, given an operand and implementing method, by calling the appropriate factory method.

public:
 static System::Linq::Expressions::UnaryExpression ^ MakeUnary(System::Linq::Expressions::ExpressionType unaryType, System::Linq::Expressions::Expression ^ operand, Type ^ type, System::Reflection::MethodInfo ^ method);
public static System.Linq.Expressions.UnaryExpression MakeUnary (System.Linq.Expressions.ExpressionType unaryType, System.Linq.Expressions.Expression operand, Type type, System.Reflection.MethodInfo method);
public static System.Linq.Expressions.UnaryExpression MakeUnary (System.Linq.Expressions.ExpressionType unaryType, System.Linq.Expressions.Expression operand, Type type, System.Reflection.MethodInfo? method);
static member MakeUnary : System.Linq.Expressions.ExpressionType * System.Linq.Expressions.Expression * Type * System.Reflection.MethodInfo -> System.Linq.Expressions.UnaryExpression
Public Shared Function MakeUnary (unaryType As ExpressionType, operand As Expression, type As Type, method As MethodInfo) As UnaryExpression

参数

unaryType
ExpressionType

指定一元运算类型的 ExpressionTypeThe ExpressionType that specifies the type of unary operation.

operand
Expression

一个表示操作数的 ExpressionAn Expression that represents the operand.

type
Type

指定转换的目标类型的 Type(如果不适用,则传递 null)。The Type that specifies the type to be converted to (pass null if not applicable).

method
MethodInfo

表示实现方法的 MethodInfoThe MethodInfo that represents the implementing method.

返回

UnaryExpression

通过调用适当的工厂方法生成的 UnaryExpressionThe UnaryExpression that results from calling the appropriate factory method.

例外

operandnulloperand is null.

unaryType 与一元表达式节点不对应。unaryType does not correspond to a unary expression node.

注解

unaryType参数确定 UnaryExpression 此方法调用的工厂方法。The unaryType parameter determines which UnaryExpression factory method this method calls. 例如,如果 unaryType 等于 Convert ,则此方法将调用 ConvertFor example, if unaryType is equal to Convert, this method invokes Convert. type如果和 method 参数不适用于调用的工厂方法,则将其忽略。The type and method parameters are ignored if they do not apply to the factory method that is called.

适用于