System.Linq.Expressions 命名空间

包含一些类、接口和枚举,它们使语言级别的代码表达式可以表示为表达式树形式的对象。 Contains classes, interfaces and enumerations that enable language-level code expressions to be represented as objects in the form of expression trees.

BinaryExpression

表示具有二进制运算符的表达式。Represents an expression that has a binary operator.

BlockExpression

表示包含一个表达式序列的块,表达式中可定义变量。Represents a block that contains a sequence of expressions where variables can be defined.

CatchBlock

表示 try 块中的 catch 语句。Represents a catch statement in a try block.

ConditionalExpression

表示具有条件运算符的表达式。Represents an expression that has a conditional operator.

ConstantExpression

表示具有常数值的表达式。Represents an expression that has a constant value.

DebugInfoExpression

发出或清除调试信息的序列点。Emits or clears a sequence point for debug information. 这使调试器能够在调试时突出显示正确的源代码。This allows the debugger to highlight the correct source code when debugging.

DefaultExpression

表示一个类型或空表达式的默认值。Represents the default value of a type or an empty expression.

DynamicExpression

表示一个动态操作。Represents a dynamic operation.

DynamicExpressionVisitor

表示动态表达式树的访问者或重写者。Represents a visitor or rewriter for dynamic expression trees.

ElementInit

表示 IEnumerable 集合的单个元素的初始值设定项。Represents an initializer for a single element of an IEnumerable collection.

Expression

提供一种基类,表示表达式树节点的类派生自该基类。Provides the base class from which the classes that represent expression tree nodes are derived. 它还包含用来创建各种节点类型的 static(在 Visual Basic 中为 Shared)工厂方法。It also contains static (Shared in Visual Basic) factory methods to create the various node types. 这是一个 abstract 类。This is an abstract class.

Expression<TDelegate>

将强类型化的 Lambda 表达式表示为表达式树形式的数据结构。Represents a strongly typed lambda expression as a data structure in the form of an expression tree. 此类不能被继承。This class cannot be inherited.

ExpressionVisitor

表示表达式树的访问者或重写者。Represents a visitor or rewriter for expression trees.

GotoExpression

表示无条件跳转。Represents an unconditional jump. 这包括返回语句,break 和 continue 语句以及其他跳转。This includes return statements, break and continue statements, and other jumps.

IndexExpression

表示对一个属性或数组进行索引。Represents indexing a property or array.

InvocationExpression

表示一个将委托或 Lambda 表达式应用到一个自变量表达式列表的表达式。Represents an expression that applies a delegate or lambda expression to a list of argument expressions.

LabelExpression

表示一个标签,可以将该标签放置在任何 Expression 上下文中。Represents a label, which can be put in any Expression context. 如果已跳转到该标签,则它将获取由对应的 GotoExpression 提供的值。If it is jumped to, it will get the value provided by the corresponding GotoExpression. 否则,它接收 DefaultValue 中的值。Otherwise, it receives the value in DefaultValue. 如果 Type 等于 System.Void,则不应提供值。If the Type equals System.Void, no value should be provided.

LabelTarget

用于表示 GotoExpression 的目标。Used to represent the target of a GotoExpression.

LambdaExpression

介绍 lambda 表达式。Describes a lambda expression. 它捕获一个类似于 .NET 方法主体的代码块。This captures a block of code that is similar to a .NET method body.

ListInitExpression

表示具有集合初始值设定项的构造函数调用。Represents a constructor call that has a collection initializer.

LoopExpression

表示无限循环。Represents an infinite loop. 可通过“中断”退出该循环。It can be exited with "break".

MemberAssignment

表示对象的字段或属性的赋值操作。Represents assignment operation for a field or property of an object.

MemberBinding

提供表示绑定的类派生自的基类,这些绑定用于对新创建对象的成员进行初始化。Provides the base class from which the classes that represent bindings that are used to initialize members of a newly created object derive.

MemberExpression

表示访问字段或属性。Represents accessing a field or property.

MemberInitExpression

表示调用构造函数并初始化新对象的一个或多个成员。Represents calling a constructor and initializing one or more members of the new object.

MemberListBinding

表示初始化新创建对象的一个集合成员的元素。Represents initializing the elements of a collection member of a newly created object.

MemberMemberBinding

表示初始化新创建对象的一个成员的成员。Represents initializing members of a member of a newly created object.

MethodCallExpression

表示对静态方法或实例方法的调用。Represents a call to either static or an instance method.

NewArrayExpression

表示创建一个新数组,并可能初始化该新数组的元素。Represents creating a new array and possibly initializing the elements of the new array.

NewExpression

表示一个构造函数调用。Represents a constructor call.

ParameterExpression

表示一个命名的参数表达式。Represents a named parameter expression.

RuntimeVariablesExpression

一个为变量提供运行时读/写权限的表达式。An expression that provides runtime read/write permission for variables.

SwitchCase

表示 SwitchExpression 的一个事例。Represents one case of a SwitchExpression.

SwitchExpression

表示一个控制表达式,该表达式通过将控制传递到 SwitchCase 来处理多重选择。Represents a control expression that handles multiple selections by passing control to SwitchCase.

SymbolDocumentInfo

存储用于发出源文件调试符号信息所必要的信息,尤其是文件名和唯一的语言标识符。Stores information necessary to emit debugging symbol information for a source file, in particular the file name and unique language identifier.

TryExpression

表示一个 try/catch/finally/fault 块。Represents a try/catch/finally/fault block.

TypeBinaryExpression

表示表达式和类型之间的操作。Represents an operation between an expression and a type.

UnaryExpression

表示具有一元运算符的表达式。Represents an expression that has a unary operator.

接口

IArgumentProvider

提供用于访问多个树节点(DynamicExpression、ElementInit、MethodCallExpression、InvocationExpression、NewExpression 和 IndexExpression)的参数的内部接口。Provides an internal interface for accessing the arguments of multiple tree nodes (DynamicExpression, ElementInit, MethodCallExpression, InvocationExpression, NewExpression, and IndexExpression). 此 API 仅供内部使用。This API is for internal use only.

IDynamicExpression

提供用于访问 DynamicExpression 树节点的参数及 CallSite 和重写功能的内部接口。Provides an internal interface for accessing the arguments of DynamicExpression tree nodes as well as CallSite and Rewriting functionality. 不应使用此 API。You should not use this API. 由于 DLL 重构,它只能是公共的;并且仅用于内部性能优化。It is only public due to DLL refactoring and exists only for internal performance optimizations.

枚举

ExpressionType

介绍表达式树节点的节点类型。Describes the node types for the nodes of an expression tree.

GotoExpressionKind

指定此 GotoExpression 表示的跳转种类。Specifies what kind of jump this GotoExpression represents.

MemberBindingType

描述 MemberInitExpression 对象中使用的绑定类型。Describes the binding types that are used in MemberInitExpression objects.

注解

抽象类 Expression 提供用于为表达式树建模的类层次结构的根。The abstract class Expression provides the root of a class hierarchy used to model expression trees.

此命名空间中派生自的类 Expression (例如 MemberExpressionParameterExpression )用于表示表达式树中的节点。The classes in this namespace that derive from Expression, for example MemberExpression and ParameterExpression, are used to represent nodes in an expression tree. Expression类包含 static (Shared Visual Basic) 工厂方法来创建各种类型的表达式树节点。The Expression class contains static (Shared in Visual Basic) factory methods to create expression tree nodes of the various types.

枚举类型 ExpressionType 指定唯一的节点类型。The enumeration type ExpressionType specifies the unique node types.