Expression.Modulo Método

Definição

Cria um BinaryExpression que representa uma operação restante aritmética.Creates a BinaryExpression that represents an arithmetic remainder operation.

Sobrecargas

Modulo(Expression, Expression)

Cria um BinaryExpression que representa uma operação restante aritmética.Creates a BinaryExpression that represents an arithmetic remainder operation.

Modulo(Expression, Expression, MethodInfo)

Cria um BinaryExpression que representa uma operação restante aritmética.Creates a BinaryExpression that represents an arithmetic remainder operation.

Modulo(Expression, Expression)

Cria um BinaryExpression que representa uma operação restante aritmética.Creates a BinaryExpression that represents an arithmetic remainder operation.

public:
 static System::Linq::Expressions::BinaryExpression ^ Modulo(System::Linq::Expressions::Expression ^ left, System::Linq::Expressions::Expression ^ right);
public static System.Linq.Expressions.BinaryExpression Modulo (System.Linq.Expressions.Expression left, System.Linq.Expressions.Expression right);
static member Modulo : System.Linq.Expressions.Expression * System.Linq.Expressions.Expression -> System.Linq.Expressions.BinaryExpression
Public Shared Function Modulo (left As Expression, right As Expression) As BinaryExpression

Parâmetros

left
Expression

Um Expression para definir a propriedade Left igual a ele.An Expression to set the Left property equal to.

right
Expression

Um Expression para definir a propriedade Right igual a ele.An Expression to set the Right property equal to.

Retornos

BinaryExpression

Um BinaryExpression que tem a propriedade NodeType igual a Modulo e as propriedades Left e Right definidas com os valores especificados.A BinaryExpression that has the NodeType property equal to Modulo and the Left and Right properties set to the specified values.

Exceções

left ou right é null.left or right is null.

O operador modulus não está definido para left.Type e right.Type.The modulus operator is not defined for left.Type and right.Type.

Comentários

O resultado BinaryExpression tem a Method propriedade definida como o método de implementação.The resulting BinaryExpression has the Method property set to the implementing method. A Type propriedade é definida como o tipo do nó.The Type property is set to the type of the node. Se o nó for levantado, as IsLifted IsLiftedToNull Propriedades e serão ambas true .If the node is lifted, the IsLifted and IsLiftedToNull properties are both true. Caso contrário, eles são false .Otherwise, they are false. A propriedade Conversion é null.The Conversion property is null.

As informações a seguir descrevem o método de implementação, o tipo de nó e se um nó é levantado.The following information describes the implementing method, the node type, and whether a node is lifted.

Implementando métodoImplementing Method

As regras a seguir determinam o método de implementação selecionado para a operação:The following rules determine the selected implementing method for the operation:

  • Se a Type propriedade de left ou right representar um tipo definido pelo usuário que sobrecarrega o operador de módulo, o MethodInfo que representa esse método é o método de implementação.If the Type property of either left or right represents a user-defined type that overloads the modulus operator, the MethodInfo that represents that method is the implementing method.

  • Caso contrário, se left . Digite e right . Tipo são tipos numéricos, o método de implementação é null .Otherwise, if left.Type and right.Type are numeric types, the implementing method is null.

Tipo de nó e versão com comparação de precisão x sem comparação de precisãoNode Type and Lifted versus Non-Lifted

Se o método de implementação não for null :If the implementing method is not null:

  • Se left . Digite e right . O tipo pode ser atribuído aos tipos de argumento correspondentes do método de implementação, o nó não é levantado.If left.Type and right.Type are assignable to the corresponding argument types of the implementing method, the node is not lifted. O tipo do nó é o tipo de retorno do método de implementação.The type of the node is the return type of the implementing method.

  • Se as duas condições a seguir forem satisfeitas, o nó será levantado e o tipo do nó será o tipo anulável que corresponde ao tipo de retorno do método de implementação:If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method:

    • left. Digite e right . O tipo são ambos os tipos de valor dos quais pelo menos um é anulável e os tipos não anuláveis correspondentes são iguais aos tipos de argumento correspondentes do método de implementação.left.Type and right.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method.

    • O tipo de retorno do método de implementação é um tipo de valor não anulável.The return type of the implementing method is a non-nullable value type.

Se o método de implementação for null :If the implementing method is null:

  • Se left . Digite e right . Os tipos são não anuláveis, o nó não é retirado.If left.Type and right.Type are both non-nullable, the node is not lifted. O tipo do nó é o tipo de resultado do operador de módulo predefinido.The type of the node is the result type of the predefined modulus operator.

  • Se left . Digite e right . Os tipos são anuláveis, o nó é levantado.If left.Type and right.Type are both nullable, the node is lifted. O tipo do nó é o tipo anulável que corresponde ao tipo de resultado do operador de módulo predefinido.The type of the node is the nullable type that corresponds to the result type of the predefined modulus operator.

Aplica-se a

Modulo(Expression, Expression, MethodInfo)

Cria um BinaryExpression que representa uma operação restante aritmética.Creates a BinaryExpression that represents an arithmetic remainder operation.

public:
 static System::Linq::Expressions::BinaryExpression ^ Modulo(System::Linq::Expressions::Expression ^ left, System::Linq::Expressions::Expression ^ right, System::Reflection::MethodInfo ^ method);
public static System.Linq.Expressions.BinaryExpression Modulo (System.Linq.Expressions.Expression left, System.Linq.Expressions.Expression right, System.Reflection.MethodInfo method);
public static System.Linq.Expressions.BinaryExpression Modulo (System.Linq.Expressions.Expression left, System.Linq.Expressions.Expression right, System.Reflection.MethodInfo? method);
static member Modulo : System.Linq.Expressions.Expression * System.Linq.Expressions.Expression * System.Reflection.MethodInfo -> System.Linq.Expressions.BinaryExpression
Public Shared Function Modulo (left As Expression, right As Expression, method As MethodInfo) As BinaryExpression

Parâmetros

left
Expression

Um Expression para definir a propriedade Left igual a ele.An Expression to set the Left property equal to.

right
Expression

Um Expression para definir a propriedade Right igual a ele.An Expression to set the Right property equal to.

method
MethodInfo

Um MethodInfo para definir a propriedade Method igual a ele.A MethodInfo to set the Method property equal to.

Retornos

BinaryExpression

Um BinaryExpression que tem a propriedade NodeType igual a Modulo e as propriedades Left, Right e Method definidas com os valores especificados.A BinaryExpression that has the NodeType property equal to Modulo and the Left, Right, and Method properties set to the specified values.

Exceções

left ou right é null.left or right is null.

method não é null e o método que ele representa retorna void, não é static (Shared no Visual Basic) ou não tem exatamente dois argumentos.method is not null and the method it represents returns void, is not static (Shared in Visual Basic), or does not take exactly two arguments.

method é null e operador de módulo não foi definido para left.Type e right.Type.method is null and the modulus operator is not defined for left.Type and right.Type.

Comentários

O resultado BinaryExpression tem a Method propriedade definida como o método de implementação.The resulting BinaryExpression has the Method property set to the implementing method. A Type propriedade é definida como o tipo do nó.The Type property is set to the type of the node. Se o nó for levantado, as IsLifted IsLiftedToNull Propriedades e serão ambas true .If the node is lifted, the IsLifted and IsLiftedToNull properties are both true. Caso contrário, eles são false .Otherwise, they are false. A propriedade Conversion é null.The Conversion property is null.

As informações a seguir descrevem o método de implementação, o tipo de nó e se um nó é levantado.The following information describes the implementing method, the node type, and whether a node is lifted.

Implementando métodoImplementing Method

O método de implementação para a operação é escolhido com base nas seguintes regras:The implementing method for the operation is chosen based on the following rules:

  • Se method não for null e representar um método que não seja void static ( Shared no Visual Basic) que usa dois argumentos, ele será o método de implementação para o nó.If method is not null and it represents a non-void, static (Shared in Visual Basic) method that takes two arguments, it is the implementing method for the node.

  • Caso contrário, se a Type propriedade de left ou right representar um tipo definido pelo usuário que sobrecarrega o operador de módulo, o MethodInfo que representa esse método é o método de implementação.Otherwise, if the Type property of either left or right represents a user-defined type that overloads the modulus operator, the MethodInfo that represents that method is the implementing method.

  • Caso contrário, se left . Digite e right . Tipo são tipos numéricos, o método de implementação é null .Otherwise, if left.Type and right.Type are numeric types, the implementing method is null.

Tipo de nó e versão com comparação de precisão x sem comparação de precisãoNode Type and Lifted versus Non-Lifted

Se o método de implementação não for null :If the implementing method is not null:

  • Se left . Digite e right . O tipo pode ser atribuído aos tipos de argumento correspondentes do método de implementação, o nó não é levantado.If left.Type and right.Type are assignable to the corresponding argument types of the implementing method, the node is not lifted. O tipo do nó é o tipo de retorno do método de implementação.The type of the node is the return type of the implementing method.

  • Se as duas condições a seguir forem satisfeitas, o nó será levantado e o tipo do nó será o tipo anulável que corresponde ao tipo de retorno do método de implementação:If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method:

    • left. Digite e right . O tipo são ambos os tipos de valor dos quais pelo menos um é anulável e os tipos não anuláveis correspondentes são iguais aos tipos de argumento correspondentes do método de implementação.left.Type and right.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method.

    • O tipo de retorno do método de implementação é um tipo de valor não anulável.The return type of the implementing method is a non-nullable value type.

Se o método de implementação for null :If the implementing method is null:

  • Se left . Digite e right . Os tipos são não anuláveis, o nó não é retirado.If left.Type and right.Type are both non-nullable, the node is not lifted. O tipo do nó é o tipo de resultado do operador de módulo predefinido.The type of the node is the result type of the predefined modulus operator.

  • Se left . Digite e right . Os tipos são anuláveis, o nó é levantado.If left.Type and right.Type are both nullable, the node is lifted. O tipo do nó é o tipo anulável que corresponde ao tipo de resultado do operador de módulo predefinido.The type of the node is the nullable type that corresponds to the result type of the predefined modulus operator.

Aplica-se a