InvocationExpression Class
This page is specific to:.NET Framework Version:3.5Silverlight 34.0
.NET Framework Class Library
InvocationExpression Class

Represents an expression that applies a delegate or lambda expression to a list of argument expressions.

Namespace:  System.Linq.Expressions
Assembly:  System.Core (in System.Core.dll)
Syntax

'Usage

Dim instance As InvocationExpression

'Declaration

Public NotInheritable Class InvocationExpression _
    Inherits Expression
Remarks

Use the Invoke factory methods to create an InvocationExpression.

The NodeType of an InvocationExpression is Invoke.

Examples

The following example creates an InvocationExpression that represents invoking a lambda expression with specified arguments.

Dim largeSumTest As System.Linq.Expressions.Expression(Of System.Func(Of Integer, Integer, Boolean)) = _
    Function(num1, num2) (num1 + num2) > 1000

' Create an InvocationExpression that represents applying
' the arguments '539' and '281' to the lambda expression 'largeSumTest'.
Dim invocationExpression As System.Linq.Expressions.InvocationExpression = _
    System.Linq.Expressions.Expression.Invoke( _
        largeSumTest, _
        System.Linq.Expressions.Expression.Constant(539), _
        System.Linq.Expressions.Expression.Constant(281))

Console.WriteLine(invocationExpression.ToString())

' This code produces the following output:
'
' Invoke((num1, num2) => ((num1 + num2) > 1000),539,281)


Inheritance Hierarchy

System..::.Object
  System.Linq.Expressions..::.Expression
    System.Linq.Expressions..::.InvocationExpression
Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information

.NET Framework

Supported in: 3.5
See Also

Reference

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View