Expression.Increment Metoda
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Vytvoří UnaryExpression hodnotu výrazu, která představuje zvýšení hodnoty výrazu o 1.
Přetížení
| Name | Description |
|---|---|
| Increment(Expression, MethodInfo) |
Vytvoří UnaryExpression hodnotu, která představuje přírůstek výrazu o 1. |
| Increment(Expression) |
Vytvoří UnaryExpression hodnotu výrazu, která představuje zvýšení hodnoty výrazu o 1. |
Increment(Expression, MethodInfo)
- Zdroj:
- UnaryExpression.cs
- Zdroj:
- UnaryExpression.cs
- Zdroj:
- UnaryExpression.cs
- Zdroj:
- UnaryExpression.cs
- Zdroj:
- UnaryExpression.cs
Vytvoří UnaryExpression hodnotu, která představuje přírůstek výrazu o 1.
public:
static System::Linq::Expressions::UnaryExpression ^ Increment(System::Linq::Expressions::Expression ^ expression, System::Reflection::MethodInfo ^ method);
public static System.Linq.Expressions.UnaryExpression Increment(System.Linq.Expressions.Expression expression, System.Reflection.MethodInfo method);
public static System.Linq.Expressions.UnaryExpression Increment(System.Linq.Expressions.Expression expression, System.Reflection.MethodInfo? method);
static member Increment : System.Linq.Expressions.Expression * System.Reflection.MethodInfo -> System.Linq.Expressions.UnaryExpression
Public Shared Function Increment (expression As Expression, method As MethodInfo) As UnaryExpression
Parametry
- expression
- Expression
To Expression inkrementace.
- method
- MethodInfo
A MethodInfo , který představuje implementovat metodu.
Návraty
A UnaryExpression , který představuje přírůstek výrazu.
Poznámky
Tento výraz je funkční a nemění hodnotu objektu, který je předán do něj.
Platí pro
Increment(Expression)
- Zdroj:
- UnaryExpression.cs
- Zdroj:
- UnaryExpression.cs
- Zdroj:
- UnaryExpression.cs
- Zdroj:
- UnaryExpression.cs
- Zdroj:
- UnaryExpression.cs
Vytvoří UnaryExpression hodnotu výrazu, která představuje zvýšení hodnoty výrazu o 1.
public:
static System::Linq::Expressions::UnaryExpression ^ Increment(System::Linq::Expressions::Expression ^ expression);
public static System.Linq.Expressions.UnaryExpression Increment(System.Linq.Expressions.Expression expression);
static member Increment : System.Linq.Expressions.Expression -> System.Linq.Expressions.UnaryExpression
Public Shared Function Increment (expression As Expression) As UnaryExpression
Parametry
- expression
- Expression
To Expression inkrementace.
Návraty
A UnaryExpression , který představuje přírůstek výrazu.
Příklady
Následující příklad kódu ukazuje, jak vytvořit výraz, který představuje operaci přírůstku.
// Add the following directive to your file:
// using System.Linq.Expressions;
// This expression represents an increment operation.
double num = 5.5;
Expression incrementExpr = Expression.Increment(
Expression.Constant(num)
);
// Print out the expression.
Console.WriteLine(incrementExpr.ToString());
// The following statement first creates an expression tree,
// then compiles it, and then executes it.
Console.WriteLine(Expression.Lambda<Func<double>>(incrementExpr).Compile()());
// The value of the variable did not change,
// because the expression is functional.
Console.WriteLine("object: " + num);
// This code example produces the following output:
//
// Increment(5.5)
// 6.5
// object: 5.5
'Add the following directive to your file:
' Imports System.Linq.Expressions
Dim num As Double = 5.5
' This expression represents an increment operation.
Dim incrementExpr As Expression = Expression.Increment(
Expression.Constant(num)
)
' Print the expression.
Console.WriteLine(incrementExpr.ToString())
' The following statement first creates an expression tree,
' then compiles it, and then executes it.
Console.WriteLine(Expression.Lambda(Of Func(Of Double))(incrementExpr).Compile()())
' The value of the variable did not change,
' because the expression is functional.
Console.WriteLine("object: " & num)
' This code example produces the following output:
'
' Increment(5.5)
' 6.5
' object: 5.5
Poznámky
Tento výraz je funkční a nemění hodnotu objektu, který je předán do něj.