mscorlib(4.0.0.0) API with additions
System.Linq.Expressions Namespace Reference

Classes

class  BinaryExpression
 Represents an expression that has a binary operator. More...
 
class  BlockExpression
 Represents a block that contains a sequence of expressions where variables can be defined. More...
 
class  CatchBlock
 Represents a catch statement in a try block. More...
 
class  ConditionalExpression
 Represents an expression that has a conditional operator. More...
 
class  ConstantExpression
 Represents an expression that has a constant value. More...
 
class  DebugInfoExpression
 Emits or clears a sequence point for debug information. This allows the debugger to highlight the correct source code when debugging. More...
 
class  DefaultExpression
 Represents the default value of a type or an empty expression. More...
 
class  DynamicExpression
 Represents a dynamic operation. More...
 
class  DynamicExpressionVisitor
 Represents a visitor or rewriter for dynamic expression trees. More...
 
class  ElementInit
 Represents an initializer for a single element of an T:System.Collections.IEnumerable collection. More...
 
class  Expression
 Provides the base class from which the classes that represent expression tree nodes are derived. It also contains static (Shared in Visual Basic) factory methods to create the various node types. This is an abstract class. More...
 
class  ExpressionVisitor
 Represents a visitor or rewriter for expression trees. More...
 
class  GotoExpression
 Represents an unconditional jump. This includes return statements, break and continue statements, and other jumps. More...
 
interface  IArgumentProvider
 Provides an internal interface for accessing the arguments of multiple tree nodes (DynamicExpression, ElementInit, MethodCallExpression, InvocationExpression, NewExpression, and InexExpression). You should not use this API. It is only public due to DLL refactoring and exists only for internal performance optimizations.This enables two optimizations which reduce the size of expression trees. The first enables the tree nodes to hold onto an IList<T> instead of a ReadOnlyCollection. IList<T> saves the cost of allocating the ReadOnlyCollection for each node. The second enables creating specialized subclasses that hold onto a specific number of arguments (for example, Block2, Block3, Block4). Therefore, these nodes avoid allocating both a ReadOnlyCollection and an array for storing their elements, saving 32 bytes per node.The expression tree nodes continue to expose the original LINQ properties of ReadOnlyCollections. The nodes do this by re-using a field for storing both the array or an element that would normally be stored in the array.For the array case, the collection is typed to IList<T> instead of ReadOnlyCollection<T>. When the node is initially constructed it is an array. When the compiler accesses the members it uses this interface. Accessing array elements promotes the array to a ReadOnlyCollection.For the object case we store the first argument in a field typed to object. When the node is initially constructed, the field holds the Expression. The compiler accesses arguments through this interface, and the accessor for the first argument uses Expression.ReturnObject to return the object that handles the Expression or ReadOnlyCollection case. When the user accesses the ReadOnlyCollection, then the object field is updated to hold directly onto the ReadOnlyCollection.It is important that the Expressions consistently return the same ReadOnlyCollection. Otherwise, the re-writer tree walker will break. It is a breaking change from LINQ v1 to return different ReadOnlyCollections form the same Expression node. Currently users can rely on object identity to tell if the node has changed. Storing the ReadOnlyCollection in an overloaded field both reduces memory usage and maintains compatibility for the public API. More...
 
interface  IDynamicExpression
 Provides an internal interface for accessing the arguments of DynamicExpression tree nodes as well as CallSite and Rewriting functionality. You should not use this API. It is only public due to DLL refactoring and exists only for internal performance optimizations. More...
 
class  IndexExpression
 Represents indexing a property or array. More...
 
class  InvocationExpression
 Represents an expression that applies a delegate or lambda expression to a list of argument expressions. More...
 
class  LabelExpression
 Represents a label, which can be put in any T:System.Linq.Expressions.Expression context. If it is jumped to, it will get the value provided by the corresponding T:System.Linq.Expressions.GotoExpression. Otherwise, it receives the value in P:System.Linq.Expressions.LabelExpression.DefaultValue. If the T:System.Type equals System.Void, no value should be provided. More...
 
class  LabelTarget
 Used to represent the target of a T:System.Linq.Expressions.GotoExpression. More...
 
class  LambdaExpression
 Describes a lambda expression. This captures a block of code that is similar to a .NET method body. More...
 
class  ListInitExpression
 Represents a constructor call that has a collection initializer. More...
 
class  LoopExpression
 Represents an infinite loop. It can be exited with "break". More...
 
class  MemberAssignment
 Represents assignment operation for a field or property of an object. More...
 
class  MemberBinding
 Provides the base class from which the classes that represent bindings that are used to initialize members of a newly created object derive. More...
 
class  MemberExpression
 Represents accessing a field or property. More...
 
class  MemberInitExpression
 Represents calling a constructor and initializing one or more members of the new object. More...
 
class  MemberListBinding
 Represents initializing the elements of a collection member of a newly created object. More...
 
class  MemberMemberBinding
 Represents initializing members of a member of a newly created object. More...
 
class  MethodCallExpression
 Represents a call to either static or an instance method. More...
 
class  NewArrayExpression
 Represents creating a new array and possibly initializing the elements of the new array. More...
 
class  NewExpression
 Represents a constructor call. More...
 
class  ParameterExpression
 Represents a named parameter expression. More...
 
class  RuntimeVariablesExpression
 An expression that provides runtime read/write permission for variables. More...
 
class  SwitchCase
 Represents one case of a T:System.Linq.Expressions.SwitchExpression. More...
 
class  SwitchExpression
 Represents a control expression that handles multiple selections by passing control to T:System.Linq.Expressions.SwitchCase. More...
 
class  SymbolDocumentInfo
 Stores information necessary to emit debugging symbol information for a source file, in particular the file name and unique language identifier. More...
 
class  TryExpression
 Represents a try/catch/finally/fault block. More...
 
class  TypeBinaryExpression
 Represents an operation between an expression and a type. More...
 
class  UnaryExpression
 Represents an expression that has a unary operator. More...
 

Enumerations

enum  AnalyzeTypeIsResult { KnownFalse, KnownTrue, KnownAssignable, Unknown }
 
enum  ExpressionType {
  ExpressionType.Add, ExpressionType.AddChecked, ExpressionType.And, ExpressionType.AndAlso,
  ExpressionType.ArrayLength, ExpressionType.ArrayIndex, ExpressionType.Call, ExpressionType.Coalesce,
  ExpressionType.Conditional, ExpressionType.Constant, ExpressionType.Convert, ExpressionType.ConvertChecked,
  ExpressionType.Divide, ExpressionType.Equal, ExpressionType.ExclusiveOr, ExpressionType.GreaterThan,
  ExpressionType.GreaterThanOrEqual, ExpressionType.Invoke, ExpressionType.Lambda, ExpressionType.LeftShift,
  ExpressionType.LessThan, ExpressionType.LessThanOrEqual, ExpressionType.ListInit, ExpressionType.MemberAccess,
  ExpressionType.MemberInit, ExpressionType.Modulo, ExpressionType.Multiply, ExpressionType.MultiplyChecked,
  ExpressionType.Negate, ExpressionType.UnaryPlus, ExpressionType.NegateChecked, ExpressionType.New,
  ExpressionType.NewArrayInit, ExpressionType.NewArrayBounds, ExpressionType.Not, ExpressionType.NotEqual,
  ExpressionType.Or, ExpressionType.OrElse, ExpressionType.Parameter, ExpressionType.Power,
  ExpressionType.Quote, ExpressionType.RightShift, ExpressionType.Subtract, ExpressionType.SubtractChecked,
  ExpressionType.TypeAs, ExpressionType.TypeIs, ExpressionType.Assign, ExpressionType.Block,
  ExpressionType.DebugInfo, ExpressionType.Decrement, ExpressionType.Dynamic, ExpressionType.Default,
  ExpressionType.Extension, ExpressionType.Goto, ExpressionType.Increment, ExpressionType.Index,
  ExpressionType.Label, ExpressionType.RuntimeVariables, ExpressionType.Loop, ExpressionType.Switch,
  ExpressionType.Throw, ExpressionType.Try, ExpressionType.Unbox, ExpressionType.AddAssign,
  ExpressionType.AndAssign, ExpressionType.DivideAssign, ExpressionType.ExclusiveOrAssign, ExpressionType.LeftShiftAssign,
  ExpressionType.ModuloAssign, ExpressionType.MultiplyAssign, ExpressionType.OrAssign, ExpressionType.PowerAssign,
  ExpressionType.RightShiftAssign, ExpressionType.SubtractAssign, ExpressionType.AddAssignChecked, ExpressionType.MultiplyAssignChecked,
  ExpressionType.SubtractAssignChecked, ExpressionType.PreIncrementAssign, ExpressionType.PreDecrementAssign, ExpressionType.PostIncrementAssign,
  ExpressionType.PostDecrementAssign, ExpressionType.TypeEqual, ExpressionType.OnesComplement, ExpressionType.IsTrue,
  ExpressionType.IsFalse
}
 Describes the node types for the nodes of an expression tree. More...
 
enum  GotoExpressionKind { GotoExpressionKind.Goto, GotoExpressionKind.Return, GotoExpressionKind.Break, GotoExpressionKind.Continue }
 Specifies what kind of jump this T:System.Linq.Expressions.GotoExpression represents. More...
 
enum  MemberBindingType { MemberBindingType.Assignment, MemberBindingType.MemberBinding, MemberBindingType.ListBinding }
 Describes the binding types that are used in T:System.Linq.Expressions.MemberInitExpression objects. More...
 

Enumeration Type Documentation

◆ ExpressionType

Describes the node types for the nodes of an expression tree.

Enumerator
Add 

An addition operation, such as a + b, without overflow checking, for numeric operands.

AddChecked 

An addition operation, such as (a + b), with overflow checking, for numeric operands.

And 

A bitwise or logical AND operation, such as (a & b) in C# and (a And b) in Visual Basic.

AndAlso 

A conditional AND operation that evaluates the second operand only if the first operand evaluates to true. It corresponds to (a && b) in C# and (a AndAlso b) in Visual Basic.

ArrayLength 

An operation that obtains the length of a one-dimensional array, such as array.Length.

ArrayIndex 

An indexing operation in a one-dimensional array, such as array[index] in C# or array(index) in Visual Basic.

Call 

A method call, such as in the obj.sampleMethod() expression.

Coalesce 

A node that represents a null coalescing operation, such as (a ?? b) in C# or If(a, b) in Visual Basic.

Conditional 

A conditional operation, such as a > b ? a : b in C# or If(a > b, a, b) in Visual Basic.

Constant 

A constant value.

Convert 

A cast or conversion operation, such as (SampleType)obj in C::or CType(obj, SampleType) in Visual Basic. For a numeric conversion, if the converted value is too large for the destination type, no exception is thrown.

ConvertChecked 

A cast or conversion operation, such as (SampleType)obj in C::or CType(obj, SampleType) in Visual Basic. For a numeric conversion, if the converted value does not fit the destination type, an exception is thrown.

Divide 

A division operation, such as (a / b), for numeric operands.

Equal 

A node that represents an equality comparison, such as (a == b) in C# or (a = b) in Visual Basic.

ExclusiveOr 

A bitwise or logical XOR operation, such as (a ^ b) in C# or (a Xor b) in Visual Basic.

GreaterThan 

A "greater than" comparison, such as (a > b).

GreaterThanOrEqual 

A "greater than or equal to" comparison, such as (a >= b).

Invoke 

An operation that invokes a delegate or lambda expression, such as sampleDelegate.Invoke().

Lambda 

A lambda expression, such as a => a + a in C# or Function(a) a + a in Visual Basic.

LeftShift 

A bitwise left-shift operation, such as (a << b).

LessThan 

A "less than" comparison, such as (a < b).

LessThanOrEqual 

A "less than or equal to" comparison, such as (a <= b).

ListInit 

An operation that creates a new T:System.Collections.IEnumerable object and initializes it from a list of elements, such as new List<SampleType>(){ a, b, c } in C# or Dim sampleList = { a, b, c } in Visual Basic.

MemberAccess 

An operation that reads from a field or property, such as obj.SampleProperty.

MemberInit 

An operation that creates a new object and initializes one or more of its members, such as new Point { X = 1, Y = 2 } in C# or New Point With {.X = 1, .Y = 2} in Visual Basic.

Modulo 

An arithmetic remainder operation, such as (a % b) in C# or (a Mod b) in Visual Basic.

Multiply 

A multiplication operation, such as (a * b), without overflow checking, for numeric operands.

MultiplyChecked 

An multiplication operation, such as (a * b), that has overflow checking, for numeric operands.

Negate 

An arithmetic negation operation, such as (-a). The object a should not be modified in place.

UnaryPlus 

A unary plus operation, such as (+a). The result of a predefined unary plus operation is the value of the operand, but user-defined implementations might have unusual results.

NegateChecked 

An arithmetic negation operation, such as (-a), that has overflow checking. The object a should not be modified in place.

New 

An operation that calls a constructor to create a new object, such as new SampleType().

NewArrayInit 

An operation that creates a new one-dimensional array and initializes it from a list of elements, such as new SampleType[]{a, b, c} in C# or New SampleType(){a, b, c} in Visual Basic.

NewArrayBounds 

An operation that creates a new array, in which the bounds for each dimension are specified, such as new SampleType[dim1, dim2] in C# or New SampleType(dim1, dim2) in Visual Basic.

Not 

A bitwise complement or logical negation operation. In C#, it is equivalent to (~a) for integral types and to (!a) for Boolean values. In Visual Basic, it is equivalent to (Not a). The object a should not be modified in place.

NotEqual 

An inequality comparison, such as (a != b) in C# or (a <> b) in Visual Basic.

Or 

A bitwise or logical OR operation, such as (a | b) in C# or (a Or b) in Visual Basic.

OrElse 

A short-circuiting conditional OR operation, such as (a || b) in C# or (a OrElse b) in Visual Basic.

Parameter 

A reference to a parameter or variable that is defined in the context of the expression. For more information, see T:System.Linq.Expressions.ParameterExpression.

Power 

A mathematical operation that raises a number to a power, such as (a ^ b) in Visual Basic.

Quote 

An expression that has a constant value of type T:System.Linq.Expressions.Expression. A F:System.Linq.Expressions.ExpressionType.Quote node can contain references to parameters that are defined in the context of the expression it represents.

RightShift 

A bitwise right-shift operation, such as (a >> b).

Subtract 

A subtraction operation, such as (a - b), without overflow checking, for numeric operands.

SubtractChecked 

An arithmetic subtraction operation, such as (a - b), that has overflow checking, for numeric operands.

TypeAs 

An explicit reference or boxing conversion in which null is supplied if the conversion fails, such as (obj as SampleType) in C# or TryCast(obj, SampleType) in Visual Basic.

TypeIs 

A type test, such as obj is SampleType in C# or TypeOf obj is SampleType in Visual Basic.

Assign 

An assignment operation, such as (a = b).

Block 

A block of expressions.

DebugInfo 

Debugging information.

Decrement 

A unary decrement operation, such as (a - 1) in C# and Visual Basic. The object a should not be modified in place.

Dynamic 

A dynamic operation.

Default 

A default value.

Extension 

An extension expression.

Goto 

A "go to" expression, such as goto Label in C# or GoTo Label in Visual Basic.

Increment 

A unary increment operation, such as (a + 1) in C# and Visual Basic. The object a should not be modified in place.

Index 

An index operation or an operation that accesses a property that takes arguments.

Label 

A label.

RuntimeVariables 

A list of run-time variables. For more information, see T:System.Linq.Expressions.RuntimeVariablesExpression.

Loop 

A loop, such as for or while.

Switch 

A switch operation, such as switch in C# or Select Case in Visual Basic.

Throw 

An operation that throws an exception, such as throw new Exception().

Try 

A try-catch expression.

Unbox 

An unbox value type operation, such as unbox and unbox.any instructions in MSIL.

AddAssign 

An addition compound assignment operation, such as (a += b), without overflow checking, for numeric operands.

AndAssign 

A bitwise or logical AND compound assignment operation, such as (a &= b) in C#.

DivideAssign 

An division compound assignment operation, such as (a /= b), for numeric operands.

ExclusiveOrAssign 

A bitwise or logical XOR compound assignment operation, such as (a ^= b) in C#.

LeftShiftAssign 

A bitwise left-shift compound assignment, such as (a <<= b).

ModuloAssign 

An arithmetic remainder compound assignment operation, such as (a %= b) in C#.

MultiplyAssign 

A multiplication compound assignment operation, such as (a *= b), without overflow checking, for numeric operands.

OrAssign 

A bitwise or logical OR compound assignment, such as (a |= b) in C#.

PowerAssign 

A compound assignment operation that raises a number to a power, such as (a ^= b) in Visual Basic.

RightShiftAssign 

A bitwise right-shift compound assignment operation, such as (a >>= b).

SubtractAssign 

A subtraction compound assignment operation, such as (a -= b), without overflow checking, for numeric operands.

AddAssignChecked 

An addition compound assignment operation, such as (a += b), with overflow checking, for numeric operands.

MultiplyAssignChecked 

A multiplication compound assignment operation, such as (a *= b), that has overflow checking, for numeric operands.

SubtractAssignChecked 

A subtraction compound assignment operation, such as (a -= b), that has overflow checking, for numeric operands.

PreIncrementAssign 

A unary prefix increment, such as (++a). The object a should be modified in place.

PreDecrementAssign 

A unary prefix decrement, such as (–a). The object a should be modified in place.

PostIncrementAssign 

A unary postfix increment, such as (a++). The object a should be modified in place.

PostDecrementAssign 

A unary postfix decrement, such as (a–). The object a should be modified in place.

TypeEqual 

An exact type test.

OnesComplement 

A ones complement operation, such as (~a) in C#.

IsTrue 

A true condition value.

IsFalse 

A false condition value.

Definition at line 5 of file ExpressionType.cs.

◆ GotoExpressionKind

Specifies what kind of jump this T:System.Linq.Expressions.GotoExpression represents.

Enumerator
Goto 

A T:System.Linq.Expressions.GotoExpression that represents a jump to some location.

Return 

A T:System.Linq.Expressions.GotoExpression that represents a return statement.

Break 

A T:System.Linq.Expressions.GotoExpression that represents a break statement.

Continue 

A T:System.Linq.Expressions.GotoExpression that represents a continue statement.

Definition at line 5 of file GotoExpressionKind.cs.

◆ MemberBindingType

Describes the binding types that are used in T:System.Linq.Expressions.MemberInitExpression objects.

Enumerator
Assignment 

A binding that represents initializing a member with the value of an expression.

MemberBinding 

A binding that represents recursively initializing members of a member.

ListBinding 

A binding that represents initializing a member of type T:System.Collections.IList or T:System.Collections.Generic.ICollection`1 from a list of elements.

Definition at line 5 of file MemberBindingType.cs.