MethodCallExpression Class
Represents calling a method.
Assembly: System.Core (in System.Core.dll)
Use the Call, ArrayIndex, or ArrayIndex factory method to create a MethodCallExpression.
The value of the NodeType property of a MethodCallExpression object is Call.
The following example creates a MethodCallExpression object that represents indexing into a two-dimensional array.
string[,] gradeArray = { {"chemistry", "history", "mathematics"}, {"78", "61", "82"} }; System.Linq.Expressions.Expression arrayExpression = System.Linq.Expressions.Expression.Constant(gradeArray); // Create a MethodCallExpression that represents indexing // into the two-dimensional array 'gradeArray' at (0, 2). // Executing the expression would return "mathematics". System.Linq.Expressions.MethodCallExpression methodCallExpression = System.Linq.Expressions.Expression.ArrayIndex( arrayExpression, System.Linq.Expressions.Expression.Constant(0), System.Linq.Expressions.Expression.Constant(2)); Console.WriteLine(methodCallExpression.ToString()); // This code produces the following output: // // value(System.String[,]).Get(0, 2)
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.