Aracılığıyla paylaş


Expression.Call Yöntem

Tanım

MethodCallExpression oluşturur.

Aşırı Yüklemeler

Name Description
Call(MethodInfo, Expression, Expression, Expression, Expression, Expression)

MethodCallExpression Beş bağımsız değişken alan statik bir yönteme yapılan çağrıyı temsil eden bir oluşturur.

Call(Expression, MethodInfo, Expression, Expression, Expression)

MethodCallExpression Üç bağımsız değişken alan bir yönteme yapılan çağrıyı temsil eden bir oluşturur.

Call(Type, String, Type[], Expression[])

MethodCallExpression Uygun fabrika yöntemini çağırarak (Shared Visual Basic'te) yöntemine yapılan çağrıyı temsil eden bir static oluşturur.

Call(MethodInfo, Expression, Expression, Expression)

MethodCallExpression Üç bağımsız değişken alan statik bir yönteme yapılan çağrıyı temsil eden bir oluşturur.

Call(Expression, String, Type[], Expression[])

MethodCallExpression Uygun fabrika yöntemini çağırarak bir yönteme yapılan çağrıyı temsil eden bir oluşturur.

Call(Expression, MethodInfo, Expression, Expression)

MethodCallExpression İki bağımsız değişken alan bir yönteme yapılan çağrıyı temsil eden bir oluşturur.

Call(MethodInfo, Expression, Expression, Expression, Expression)

MethodCallExpression Dört bağımsız değişken alan statik bir yönteme yapılan çağrıyı temsil eden bir oluşturur.

Call(Expression, MethodInfo, Expression[])

MethodCallExpression Bağımsız değişkenleri alan bir yönteme yapılan çağrıyı temsil eden bir oluşturur.

Call(Expression, MethodInfo, IEnumerable<Expression>)

MethodCallExpression Bağımsız değişkenleri alan bir yönteme yapılan çağrıyı temsil eden bir oluşturur.

Call(MethodInfo, Expression[])

MethodCallExpression Bağımsız değişkenleri olan bir (Shared Visual Basic'te) yöntemine yapılan çağrıyı temsil eden bir static oluşturur.

Call(MethodInfo, Expression)

Bir MethodCallExpression bağımsız değişken alan (SharedVisual Basic'te) yöntemine yapılan çağrıyı temsil eden bir static oluşturur.

Call(MethodInfo, IEnumerable<Expression>)

MethodCallExpression Statik (Visual Basic'te Paylaşılan) yöntemine yapılan çağrıyı temsil eden bir oluşturur.

Call(Expression, MethodInfo)

MethodCallExpression Bağımsız değişken içermeyen bir yönteme yapılan çağrıyı temsil eden bir oluşturur.

Call(MethodInfo, Expression, Expression)

MethodCallExpression İki bağımsız değişken alan statik bir yönteme yapılan çağrıyı temsil eden bir oluşturur.

Call(MethodInfo, Expression, Expression, Expression, Expression, Expression)

Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs

MethodCallExpression Beş bağımsız değişken alan statik bir yönteme yapılan çağrıyı temsil eden bir oluşturur.

public:
 static System::Linq::Expressions::MethodCallExpression ^ Call(System::Reflection::MethodInfo ^ method, System::Linq::Expressions::Expression ^ arg0, System::Linq::Expressions::Expression ^ arg1, System::Linq::Expressions::Expression ^ arg2, System::Linq::Expressions::Expression ^ arg3, System::Linq::Expressions::Expression ^ arg4);
public static System.Linq.Expressions.MethodCallExpression Call(System.Reflection.MethodInfo method, System.Linq.Expressions.Expression arg0, System.Linq.Expressions.Expression arg1, System.Linq.Expressions.Expression arg2, System.Linq.Expressions.Expression arg3, System.Linq.Expressions.Expression arg4);
static member Call : System.Reflection.MethodInfo * System.Linq.Expressions.Expression * System.Linq.Expressions.Expression * System.Linq.Expressions.Expression * System.Linq.Expressions.Expression * System.Linq.Expressions.Expression -> System.Linq.Expressions.MethodCallExpression
Public Shared Function Call (method As MethodInfo, arg0 As Expression, arg1 As Expression, arg2 As Expression, arg3 As Expression, arg4 As Expression) As MethodCallExpression

Parametreler

method
MethodInfo

Özelliğinin Method değerine eşit olarak ayarlanması için AMethodInfo.

arg0
Expression

Expression İlk bağımsız değişkeni temsil eden.

arg1
Expression

Expression İkinci bağımsız değişkeni temsil eden.

arg2
Expression

Üçüncü Expression bağımsız değişkeni temsil eden.

arg3
Expression

Expression Dördüncü bağımsız değişkeni temsil eden.

arg4
Expression

Expression Beşinci bağımsız değişkeni temsil eden.

Döndürülenler

MethodCallExpression özelliğine CallNodeType eşit ve ve MethodObject özellikleri belirtilen değerlere ayarlanmış bir.

Özel durumlar

method null değeridir.

Şunlara uygulanır

Call(Expression, MethodInfo, Expression, Expression, Expression)

Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs

MethodCallExpression Üç bağımsız değişken alan bir yönteme yapılan çağrıyı temsil eden bir oluşturur.

public:
 static System::Linq::Expressions::MethodCallExpression ^ Call(System::Linq::Expressions::Expression ^ instance, System::Reflection::MethodInfo ^ method, System::Linq::Expressions::Expression ^ arg0, System::Linq::Expressions::Expression ^ arg1, System::Linq::Expressions::Expression ^ arg2);
public static System.Linq.Expressions.MethodCallExpression Call(System.Linq.Expressions.Expression instance, System.Reflection.MethodInfo method, System.Linq.Expressions.Expression arg0, System.Linq.Expressions.Expression arg1, System.Linq.Expressions.Expression arg2);
public static System.Linq.Expressions.MethodCallExpression Call(System.Linq.Expressions.Expression? instance, System.Reflection.MethodInfo method, System.Linq.Expressions.Expression arg0, System.Linq.Expressions.Expression arg1, System.Linq.Expressions.Expression arg2);
static member Call : System.Linq.Expressions.Expression * System.Reflection.MethodInfo * System.Linq.Expressions.Expression * System.Linq.Expressions.Expression * System.Linq.Expressions.Expression -> System.Linq.Expressions.MethodCallExpression
Public Shared Function Call (instance As Expression, method As MethodInfo, arg0 As Expression, arg1 As Expression, arg2 As Expression) As MethodCallExpression

Parametreler

instance
Expression

Örnek Expression çağrısının örneğini belirten bir. (statik (Visual Basic'te paylaşılan) yöntemi için null geçirme).

method
MethodInfo

MethodInfo Hedef yöntemi temsil eden.

arg0
Expression

Expression İlk bağımsız değişkeni temsil eden.

arg1
Expression

Expression İkinci bağımsız değişkeni temsil eden.

arg2
Expression

Üçüncü Expression bağımsız değişkeni temsil eden.

Döndürülenler

MethodCallExpression özelliğine CallNodeType eşit ve ve MethodObject özellikleri belirtilen değerlere ayarlanmış bir.

Şunlara uygulanır

Call(Type, String, Type[], Expression[])

Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs

MethodCallExpression Uygun fabrika yöntemini çağırarak (Shared Visual Basic'te) yöntemine yapılan çağrıyı temsil eden bir static oluşturur.

public:
 static System::Linq::Expressions::MethodCallExpression ^ Call(Type ^ type, System::String ^ methodName, cli::array <Type ^> ^ typeArguments, ... cli::array <System::Linq::Expressions::Expression ^> ^ arguments);
public static System.Linq.Expressions.MethodCallExpression Call(Type type, string methodName, Type[] typeArguments, params System.Linq.Expressions.Expression[] arguments);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Calling a generic method requires dynamic code generation. This can be suppressed if the method is not generic.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Calling a generic method cannot be statically analyzed. It's not possible to guarantee the availability of requirements of the generic method. This can be suppressed if the method is not generic.")]
public static System.Linq.Expressions.MethodCallExpression Call(Type type, string methodName, Type[]? typeArguments, params System.Linq.Expressions.Expression[]? arguments);
public static System.Linq.Expressions.MethodCallExpression Call(Type type, string methodName, Type[]? typeArguments, params System.Linq.Expressions.Expression[]? arguments);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Calling a generic method cannot be statically analyzed. It's not possible to guarantee the availability of requirements of the generic method. This can be suppressed if the method is not generic.")]
public static System.Linq.Expressions.MethodCallExpression Call(Type type, string methodName, Type[]? typeArguments, params System.Linq.Expressions.Expression[]? arguments);
static member Call : Type * string * Type[] * System.Linq.Expressions.Expression[] -> System.Linq.Expressions.MethodCallExpression
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Calling a generic method requires dynamic code generation. This can be suppressed if the method is not generic.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Calling a generic method cannot be statically analyzed. It's not possible to guarantee the availability of requirements of the generic method. This can be suppressed if the method is not generic.")>]
static member Call : Type * string * Type[] * System.Linq.Expressions.Expression[] -> System.Linq.Expressions.MethodCallExpression
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Calling a generic method cannot be statically analyzed. It's not possible to guarantee the availability of requirements of the generic method. This can be suppressed if the method is not generic.")>]
static member Call : Type * string * Type[] * System.Linq.Expressions.Expression[] -> System.Linq.Expressions.MethodCallExpression
Public Shared Function Call (type As Type, methodName As String, typeArguments As Type(), ParamArray arguments As Expression()) As MethodCallExpression

Parametreler

type
Type

Belirtilen static (Shared Visual Basic'te) yöntemini içeren tür.

methodName
String

yönteminin adı.

typeArguments
Type[]

Genel yöntemin Type tür parametrelerini belirten bir nesne dizisi. methodName genel olmayan bir yöntem belirttiğinde bu bağımsız değişken null olmalıdır.

arguments
Expression[]

yönteminin Expression bağımsız değişkenlerini temsil eden bir nesne dizisi.

Döndürülenler

MethodCallExpression özelliğine Calleşit olanNodeType, Method özelliği MethodInfo belirtilen static (Shared Visual Basic'te) yöntemini temsil eden değerine ayarlanmış özellik ve Arguments belirtilen bağımsız değişkenlere ayarlanmış özellik.

Öznitelikler

Özel durumlar

type veya methodName şeklindedir null.

Adı methodName, türü parametreleri ile eşleşen ve parametre türleri eşleşen typeArgumentsveya temel türlerinde argumentstype bulunan bir yöntem yoktur.

-veya-

Adı methodName, türü parametreleri ile eşleşen ve parametre türleri eşleşen typeArgumentsveya temel türlerinde argumentstype bulunan birden fazla yöntem.

Açıklamalar

Sonuçta TypeMethodCallExpression elde edilen özelliği, tarafından methodNamebelirtilen yöntemin dönüş türüne eşittir. Object özelliği null.

Şunlara uygulanır

Call(MethodInfo, Expression, Expression, Expression)

Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs

MethodCallExpression Üç bağımsız değişken alan statik bir yönteme yapılan çağrıyı temsil eden bir oluşturur.

public:
 static System::Linq::Expressions::MethodCallExpression ^ Call(System::Reflection::MethodInfo ^ method, System::Linq::Expressions::Expression ^ arg0, System::Linq::Expressions::Expression ^ arg1, System::Linq::Expressions::Expression ^ arg2);
public static System.Linq.Expressions.MethodCallExpression Call(System.Reflection.MethodInfo method, System.Linq.Expressions.Expression arg0, System.Linq.Expressions.Expression arg1, System.Linq.Expressions.Expression arg2);
static member Call : System.Reflection.MethodInfo * System.Linq.Expressions.Expression * System.Linq.Expressions.Expression * System.Linq.Expressions.Expression -> System.Linq.Expressions.MethodCallExpression
Public Shared Function Call (method As MethodInfo, arg0 As Expression, arg1 As Expression, arg2 As Expression) As MethodCallExpression

Parametreler

method
MethodInfo

Özelliğinin Method değerine eşit olarak ayarlanması için AMethodInfo.

arg0
Expression

Expression İlk bağımsız değişkeni temsil eden.

arg1
Expression

Expression İkinci bağımsız değişkeni temsil eden.

arg2
Expression

Üçüncü Expression bağımsız değişkeni temsil eden.

Döndürülenler

MethodCallExpression özelliğine CallNodeType eşit ve ve MethodObject özellikleri belirtilen değerlere ayarlanmış bir.

Özel durumlar

method null değeridir.

Şunlara uygulanır

Call(Expression, String, Type[], Expression[])

Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs

MethodCallExpression Uygun fabrika yöntemini çağırarak bir yönteme yapılan çağrıyı temsil eden bir oluşturur.

public:
 static System::Linq::Expressions::MethodCallExpression ^ Call(System::Linq::Expressions::Expression ^ instance, System::String ^ methodName, cli::array <Type ^> ^ typeArguments, ... cli::array <System::Linq::Expressions::Expression ^> ^ arguments);
public static System.Linq.Expressions.MethodCallExpression Call(System.Linq.Expressions.Expression instance, string methodName, Type[] typeArguments, params System.Linq.Expressions.Expression[] arguments);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Calling a generic method requires dynamic code generation. This can be suppressed if the method is not generic.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Creating Expressions requires unreferenced code because the members being referenced by the Expression may be trimmed.")]
public static System.Linq.Expressions.MethodCallExpression Call(System.Linq.Expressions.Expression instance, string methodName, Type[]? typeArguments, params System.Linq.Expressions.Expression[]? arguments);
public static System.Linq.Expressions.MethodCallExpression Call(System.Linq.Expressions.Expression instance, string methodName, Type[]? typeArguments, params System.Linq.Expressions.Expression[]? arguments);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Creating Expressions requires unreferenced code because the members being referenced by the Expression may be trimmed.")]
public static System.Linq.Expressions.MethodCallExpression Call(System.Linq.Expressions.Expression instance, string methodName, Type[]? typeArguments, params System.Linq.Expressions.Expression[]? arguments);
static member Call : System.Linq.Expressions.Expression * string * Type[] * System.Linq.Expressions.Expression[] -> System.Linq.Expressions.MethodCallExpression
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Calling a generic method requires dynamic code generation. This can be suppressed if the method is not generic.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Creating Expressions requires unreferenced code because the members being referenced by the Expression may be trimmed.")>]
static member Call : System.Linq.Expressions.Expression * string * Type[] * System.Linq.Expressions.Expression[] -> System.Linq.Expressions.MethodCallExpression
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Creating Expressions requires unreferenced code because the members being referenced by the Expression may be trimmed.")>]
static member Call : System.Linq.Expressions.Expression * string * Type[] * System.Linq.Expressions.Expression[] -> System.Linq.Expressions.MethodCallExpression
Public Shared Function Call (instance As Expression, methodName As String, typeArguments As Type(), ParamArray arguments As Expression()) As MethodCallExpression

Parametreler

instance
Expression

Expression Belirli bir yöntem için özellik değeri aranacak olanType.

methodName
String

yönteminin adı.

typeArguments
Type[]

Genel yöntemin Type tür parametrelerini belirten bir nesne dizisi. methodName genel olmayan bir yöntem belirttiğinde bu bağımsız değişken null olmalıdır.

arguments
Expression[]

yönteminin Expression bağımsız değişkenlerini temsil eden bir nesne dizisi.

Döndürülenler

MethodCallExpression özelliğine Calleşit olanNodeType, Object özelliğine MethodInfoinstanceMethod eşit olan özelliği, belirtilen örnek yöntemini temsil eden değerine ayarlanır ve Arguments belirtilen bağımsız değişkenlere ayarlanır.

Öznitelikler

Özel durumlar

instance veya methodName şeklindedir null.

Türü parametreleri ile eşleşen ve parametre türleri arguments eşleşen typeArgumentsadı methodNameolan hiçbir yöntem içinde instancebulunmaz. Tür veya temel türleri.

-veya-

Adı methodNameolan, türü parametreleri ile eşleşen ve parametre türleri eşleşen typeArgumentsarguments birden çok yöntem içinde instancebulunur. Tür veya temel türleri.

Açıklamalar

Sonuçta TypeMethodCallExpression elde edilen özelliği, tarafından methodNamebelirtilen yöntemin dönüş türüne eşittir.

Şunlara uygulanır

Call(Expression, MethodInfo, Expression, Expression)

Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs

MethodCallExpression İki bağımsız değişken alan bir yönteme yapılan çağrıyı temsil eden bir oluşturur.

public:
 static System::Linq::Expressions::MethodCallExpression ^ Call(System::Linq::Expressions::Expression ^ instance, System::Reflection::MethodInfo ^ method, System::Linq::Expressions::Expression ^ arg0, System::Linq::Expressions::Expression ^ arg1);
public static System.Linq.Expressions.MethodCallExpression Call(System.Linq.Expressions.Expression instance, System.Reflection.MethodInfo method, System.Linq.Expressions.Expression arg0, System.Linq.Expressions.Expression arg1);
public static System.Linq.Expressions.MethodCallExpression Call(System.Linq.Expressions.Expression? instance, System.Reflection.MethodInfo method, System.Linq.Expressions.Expression arg0, System.Linq.Expressions.Expression arg1);
static member Call : System.Linq.Expressions.Expression * System.Reflection.MethodInfo * System.Linq.Expressions.Expression * System.Linq.Expressions.Expression -> System.Linq.Expressions.MethodCallExpression
Public Shared Function Call (instance As Expression, method As MethodInfo, arg0 As Expression, arg1 As Expression) As MethodCallExpression

Parametreler

instance
Expression

Örnek Expression çağrısının örneğini belirten bir. (statik (Visual Basic'te paylaşılan) yöntemi için null geçirme).

method
MethodInfo

MethodInfo Hedef yöntemi temsil eden.

arg0
Expression

Expression İlk bağımsız değişkeni temsil eden.

arg1
Expression

Expression İkinci bağımsız değişkeni temsil eden.

Döndürülenler

MethodCallExpression özelliğine CallNodeType eşit ve ve MethodObject özellikleri belirtilen değerlere ayarlanmış bir.

Örnekler

Aşağıdaki kod örneği, iki bağımsız değişkeni olan bir örnek yöntemini çağıran bir ifadenin nasıl oluşturulacağını gösterir.

// Add the following directive to your file:
// using System.Linq.Expressions;
public class SampleClass
{
    public int AddIntegers(int arg1, int arg2)
    {
        return arg1 + arg2;
    }
}

static public void TestCall()
{
    // This expression represents a call to an instance method that has two arguments.
    // The first argument is an expression that creates a new object of the specified type.
    Expression callExpr = Expression.Call(
        Expression.New(typeof(SampleClass)),
        typeof(SampleClass).GetMethod("AddIntegers", new Type[] { typeof(int), typeof(int) }),
        Expression.Constant(1),
        Expression.Constant(2)
        );

    // Print out the expression.
    Console.WriteLine(callExpr.ToString());

    // The following statement first creates an expression tree,
    // then compiles it, and then executes it.
    Console.WriteLine(Expression.Lambda<Func<int>>(callExpr).Compile()());

    // This code example produces the following output:
    //
    // new SampleClass().AddIntegers(1, 2)
    // 3
}
' Add the following directive to your file:
' Imports System.Linq.Expressions  

Public Class SampleClass
    Public Function AddIntegers(ByVal arg1 As Integer, ByVal arg2 As Integer) As Integer
        Return (arg1 + arg2)
    End Function
End Class
Public Shared Sub TestCall()
    ' This expression represents a call to an instance method that has two arguments.
    ' The first argument is an expression that creates a new object of the specified type.
    Dim callExpr As Expression = Expression.Call(
        Expression.[New](GetType(SampleClass)),
        GetType(SampleClass).GetMethod("AddIntegers", New Type() {GetType(Integer), GetType(Integer)}),
        Expression.Constant(1),
        Expression.Constant(2)
      )

    ' Print the expression.
    Console.WriteLine(callExpr.ToString())

    ' The following statement first creates an expression tree,
    ' then compiles it, and then executes it.
    Console.WriteLine(Expression.Lambda(Of Func(Of Integer))(callExpr).Compile()())
End Sub

' This code example produces the following output:
'
' new SampleClass().AddIntegers(1, 2)
' 3

Şunlara uygulanır

Call(MethodInfo, Expression, Expression, Expression, Expression)

Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs

MethodCallExpression Dört bağımsız değişken alan statik bir yönteme yapılan çağrıyı temsil eden bir oluşturur.

public:
 static System::Linq::Expressions::MethodCallExpression ^ Call(System::Reflection::MethodInfo ^ method, System::Linq::Expressions::Expression ^ arg0, System::Linq::Expressions::Expression ^ arg1, System::Linq::Expressions::Expression ^ arg2, System::Linq::Expressions::Expression ^ arg3);
public static System.Linq.Expressions.MethodCallExpression Call(System.Reflection.MethodInfo method, System.Linq.Expressions.Expression arg0, System.Linq.Expressions.Expression arg1, System.Linq.Expressions.Expression arg2, System.Linq.Expressions.Expression arg3);
static member Call : System.Reflection.MethodInfo * System.Linq.Expressions.Expression * System.Linq.Expressions.Expression * System.Linq.Expressions.Expression * System.Linq.Expressions.Expression -> System.Linq.Expressions.MethodCallExpression
Public Shared Function Call (method As MethodInfo, arg0 As Expression, arg1 As Expression, arg2 As Expression, arg3 As Expression) As MethodCallExpression

Parametreler

method
MethodInfo

Özelliğinin Method değerine eşit olarak ayarlanması için AMethodInfo.

arg0
Expression

Expression İlk bağımsız değişkeni temsil eden.

arg1
Expression

Expression İkinci bağımsız değişkeni temsil eden.

arg2
Expression

Üçüncü Expression bağımsız değişkeni temsil eden.

arg3
Expression

Expression Dördüncü bağımsız değişkeni temsil eden.

Döndürülenler

MethodCallExpression özelliğine CallNodeType eşit ve ve MethodObject özellikleri belirtilen değerlere ayarlanmış bir.

Özel durumlar

method null değeridir.

Şunlara uygulanır

Call(Expression, MethodInfo, Expression[])

Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs

MethodCallExpression Bağımsız değişkenleri alan bir yönteme yapılan çağrıyı temsil eden bir oluşturur.

public:
 static System::Linq::Expressions::MethodCallExpression ^ Call(System::Linq::Expressions::Expression ^ instance, System::Reflection::MethodInfo ^ method, ... cli::array <System::Linq::Expressions::Expression ^> ^ arguments);
public static System.Linq.Expressions.MethodCallExpression Call(System.Linq.Expressions.Expression instance, System.Reflection.MethodInfo method, params System.Linq.Expressions.Expression[] arguments);
public static System.Linq.Expressions.MethodCallExpression Call(System.Linq.Expressions.Expression? instance, System.Reflection.MethodInfo method, params System.Linq.Expressions.Expression[]? arguments);
static member Call : System.Linq.Expressions.Expression * System.Reflection.MethodInfo * System.Linq.Expressions.Expression[] -> System.Linq.Expressions.MethodCallExpression
Public Shared Function Call (instance As Expression, method As MethodInfo, ParamArray arguments As Expression()) As MethodCallExpression

Parametreler

instance
Expression

Bir Expression örnek yöntemi çağrısının örneğini belirten bir (Visual Basic'te )Shared yöntemi için static geçirinnull.

method
MethodInfo

Özelliğinin Method değerine eşit olarak ayarlanması için AMethodInfo.

arguments
Expression[]

Koleksiyonu doldurmak Arguments için kullanılacak bir nesne dizisiExpression.

Döndürülenler

MethodCallExpression özelliğine CallNodeType eşit olan ve Object, Methodve Arguments özellikleri belirtilen değerlere ayarlanmış.

Özel durumlar

method, null'e eşittir.

-veya-

instance method ve null bir örnek yöntemini temsil eder.

-veya-

arguments değildir null ve öğelerinden biri veya daha fazlası şeklindedir null.

instance. türü, tarafından methodtemsil edilen yöntemin bildirim türüne atanamaz.

-veya-

içindeki arguments öğe sayısı, tarafından methodtemsil edilen yöntemin parametre sayısına eşit değildir.

-veya-

öğesinden arguments bir veya daha fazlası tarafından methodtemsil edilen yöntemin ilgili parametresine atanamaz.

Açıklamalar

Bir ( Visual Basic'te) yöntemine yapılan çağrıyı temsil etmek static için, bu yöntemi çağırdığınızda parametresini instance geçirin null veya bunun yerine çağırınCall.Shared

Bir örnek yöntemini temsil ediyorsanız method , özelliğinin Typeinstance tarafından methodtemsil edilen yöntemin bildirim türüne atanabilir olması gerekir.

nulldeğilsearguments, tarafından temsil edilen methodyöntemin parametre sayısıyla aynı sayıda öğeye sahip olmalıdır. içindeki arguments her öğe olmamalıdır null ve büyük olasılıkla alıntı yaptıktan sonra öğesine karşılık gelen parametresine methodatanabilir olmalıdır.

Uyarı

Bir öğe yalnızca ilgili yöntem parametresi türündeyse Expressiontırnak içine alınır. Alıntılama, öğenin bir Quote düğümde sarmalanması anlamına gelir. Sonuçta elde edilen düğüm, özelliği öğesinin argumentsöğesi olan bir UnaryExpressionOperand düğümdür.

Arguments sonucunun MethodCallExpression özelliği ise arguments boş olurnull. Aksi takdirde, ile aynı öğeleri argumentsiçerir ve bazıları tırnak içine alınabilir.

Sonuçta TypeMethodCallExpression elde edilen özelliği, tarafından methodtemsil edilen yöntemin dönüş türüne eşittir.

Şunlara uygulanır

Call(Expression, MethodInfo, IEnumerable<Expression>)

Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs

MethodCallExpression Bağımsız değişkenleri alan bir yönteme yapılan çağrıyı temsil eden bir oluşturur.

public:
 static System::Linq::Expressions::MethodCallExpression ^ Call(System::Linq::Expressions::Expression ^ instance, System::Reflection::MethodInfo ^ method, System::Collections::Generic::IEnumerable<System::Linq::Expressions::Expression ^> ^ arguments);
public static System.Linq.Expressions.MethodCallExpression Call(System.Linq.Expressions.Expression instance, System.Reflection.MethodInfo method, System.Collections.Generic.IEnumerable<System.Linq.Expressions.Expression> arguments);
public static System.Linq.Expressions.MethodCallExpression Call(System.Linq.Expressions.Expression? instance, System.Reflection.MethodInfo method, System.Collections.Generic.IEnumerable<System.Linq.Expressions.Expression>? arguments);
static member Call : System.Linq.Expressions.Expression * System.Reflection.MethodInfo * seq<System.Linq.Expressions.Expression> -> System.Linq.Expressions.MethodCallExpression
Public Shared Function Call (instance As Expression, method As MethodInfo, arguments As IEnumerable(Of Expression)) As MethodCallExpression

Parametreler

instance
Expression

özelliğinin Object değerine eşit olarak ayarlanması için static bir (Visual Basic'te (Shared visual basic yönteminde) değerini geçirinnull.Expression

method
MethodInfo

Özelliğinin Method değerine eşit olarak ayarlanması için AMethodInfo.

arguments
IEnumerable<Expression>

IEnumerable<T> Koleksiyonu doldurmak Arguments için kullanılacak nesneleri içerenExpression.

Döndürülenler

MethodCallExpression özelliğine CallNodeType eşit olan ve Object, Methodve Arguments özellikleri belirtilen değerlere ayarlanmış.

Özel durumlar

method, null'e eşittir.

-veya-

instance method ve null bir örnek yöntemini temsil eder.

instance. türü, tarafından methodtemsil edilen yöntemin bildirim türüne atanamaz.

-veya-

içindeki arguments öğe sayısı, tarafından methodtemsil edilen yöntemin parametre sayısına eşit değildir.

-veya-

öğesinden arguments bir veya daha fazlası tarafından methodtemsil edilen yöntemin ilgili parametresine atanamaz.

Açıklamalar

Bir ( Visual Basic'te) yöntemine yapılan çağrıyı temsil etmek static için, bu yöntemi çağırdığınızda parametresini instance geçirin null veya bunun yerine çağırınCall.Shared

Bir örnek yöntemini temsil ediyorsanız method , özelliğinin Typeinstance tarafından methodtemsil edilen yöntemin bildirim türüne atanabilir olması gerekir.

nulldeğilsearguments, tarafından temsil edilen methodyöntemin parametre sayısıyla aynı sayıda öğeye sahip olmalıdır. içindeki arguments her öğe olmamalıdır null ve büyük olasılıkla alıntı yaptıktan sonra öğesine karşılık gelen parametresine methodatanabilir olmalıdır.

Uyarı

Bir öğe yalnızca ilgili yöntem parametresi türündeyse Expressiontırnak içine alınır. Alıntılama, öğenin bir Quote düğümde sarmalanması anlamına gelir. Sonuçta elde edilen düğüm, özelliği öğesinin argumentsöğesi olan bir UnaryExpressionOperand düğümdür.

Arguments sonucunun MethodCallExpression özelliği ise arguments boş olurnull. Aksi takdirde, ile aynı öğeleri argumentsiçerir ve bazıları tırnak içine alınabilir.

Sonuçta TypeMethodCallExpression elde edilen özelliği, tarafından methodtemsil edilen yöntemin dönüş türüne eşittir.

Şunlara uygulanır

Call(MethodInfo, Expression[])

Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs

MethodCallExpression Bağımsız değişkenleri olan bir (Shared Visual Basic'te) yöntemine yapılan çağrıyı temsil eden bir static oluşturur.

public:
 static System::Linq::Expressions::MethodCallExpression ^ Call(System::Reflection::MethodInfo ^ method, ... cli::array <System::Linq::Expressions::Expression ^> ^ arguments);
public static System.Linq.Expressions.MethodCallExpression Call(System.Reflection.MethodInfo method, params System.Linq.Expressions.Expression[] arguments);
public static System.Linq.Expressions.MethodCallExpression Call(System.Reflection.MethodInfo method, params System.Linq.Expressions.Expression[]? arguments);
static member Call : System.Reflection.MethodInfo * System.Linq.Expressions.Expression[] -> System.Linq.Expressions.MethodCallExpression
Public Shared Function Call (method As MethodInfo, ParamArray arguments As Expression()) As MethodCallExpression

Parametreler

method
MethodInfo

MethodInfo Özelliğinin eşit olarak ayarlanacağı Method bir static (Shared Visual Basic'te) yöntemini temsil eden bir.

arguments
Expression[]

Koleksiyonu doldurmak Arguments için kullanılacak bir nesne dizisiExpression.

Döndürülenler

MethodCallExpression özelliğine CallNodeType eşit ve ve ArgumentsMethod özellikleri belirtilen değerlere ayarlanmış bir.

Özel durumlar

method, null'e eşittir.

içindeki arguments öğe sayısı, tarafından methodtemsil edilen yöntemin parametre sayısına eşit değildir.

-veya-

öğesinden arguments bir veya daha fazlası tarafından methodtemsil edilen yöntemin ilgili parametresine atanamaz.

Açıklamalar

nulldeğilsearguments, tarafından temsil edilen methodyöntemin parametre sayısıyla aynı sayıda öğeye sahip olmalıdır. içindeki arguments her öğe olmamalıdır null ve büyük olasılıkla alıntı yaptıktan sonra öğesine karşılık gelen parametresine methodatanabilir olmalıdır.

Uyarı

Bir öğe yalnızca ilgili yöntem parametresi türündeyse Expressiontırnak içine alınır. Alıntılama, öğenin bir Quote düğümde sarmalanması anlamına gelir. Sonuçta elde edilen düğüm, özelliği öğesinin argumentsöğesi olan bir UnaryExpressionOperand düğümdür.

Arguments sonucunun MethodCallExpression özelliği ise arguments boş olurnull. Aksi takdirde, ile aynı öğeleri argumentsiçerir ve bazıları tırnak içine alınabilir.

Sonuçta TypeMethodCallExpression elde edilen özelliği, tarafından methodtemsil edilen yöntemin dönüş türüne eşittir. Object özelliği null.

Şunlara uygulanır

Call(MethodInfo, Expression)

Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs

Bir MethodCallExpression bağımsız değişken alan (SharedVisual Basic'te) yöntemine yapılan çağrıyı temsil eden bir static oluşturur.

public:
 static System::Linq::Expressions::MethodCallExpression ^ Call(System::Reflection::MethodInfo ^ method, System::Linq::Expressions::Expression ^ arg0);
public static System.Linq.Expressions.MethodCallExpression Call(System.Reflection.MethodInfo method, System.Linq.Expressions.Expression arg0);
static member Call : System.Reflection.MethodInfo * System.Linq.Expressions.Expression -> System.Linq.Expressions.MethodCallExpression
Public Shared Function Call (method As MethodInfo, arg0 As Expression) As MethodCallExpression

Parametreler

method
MethodInfo

Özelliğinin Method değerine eşit olarak ayarlanması için AMethodInfo.

arg0
Expression

Expression İlk bağımsız değişkeni temsil eden.

Döndürülenler

MethodCallExpression özelliğine CallNodeType eşit ve ve MethodObject özellikleri belirtilen değerlere ayarlanmış bir.

Özel durumlar

method null değeridir.

Örnekler

Aşağıdaki örnekte, bir bağımsız değişken alan (SharedVisual Basic'te) yöntemini çağıran bir static ifadenin nasıl oluşturulacağı gösterilmektedir.

// Add the following directive to your file:
// using System.Linq.Expressions;

public class SampleClass
{
    public static int Increment(int arg1)
    {
        return arg1 + 1;
    }
}

static public void TestCall()
{

    //This expression represents a call to an instance method with one argument.
    Expression callExpr = Expression.Call(
                            typeof(SampleClass).GetMethod("Increment"),
                            Expression.Constant(2)
                        );

    // Print out the expression.
    Console.WriteLine(callExpr.ToString());

    // The following statement first creates an expression tree,
    // then compiles it, and then executes it.
    Console.WriteLine(Expression.Lambda<Func<int>>(callExpr).Compile()());

    // This code example produces the following output:
    //
    // Increment(2)
    // 3
}
' Add the following directive to your file:
' Imports System.Linq.Expressions  

Public Class SampleClass
    Shared Function Increment(ByVal arg1 As Integer) As Integer
        Return arg1 + 1
    End Function
End Class
Shared Sub TestCall()
    'This expression represents a call to an instance method with one argument.
    Dim callExpr As Expression = Expression.Call(
        GetType(SampleClass).GetMethod("Increment"),
        Expression.Constant(2))

    ' Print the expression.
    Console.WriteLine(callExpr.ToString())

    ' The following statement first creates an expression tree,
    ' then compiles it, and then executes it.
    Console.WriteLine(Expression.Lambda(Of Func(Of Integer))(callExpr).Compile()())
End Sub

' This code example produces the following output:
'
' Increment(2)
' 3

Şunlara uygulanır

Call(MethodInfo, IEnumerable<Expression>)

Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs

MethodCallExpression Statik (Visual Basic'te Paylaşılan) yöntemine yapılan çağrıyı temsil eden bir oluşturur.

public:
 static System::Linq::Expressions::MethodCallExpression ^ Call(System::Reflection::MethodInfo ^ method, System::Collections::Generic::IEnumerable<System::Linq::Expressions::Expression ^> ^ arguments);
public static System.Linq.Expressions.MethodCallExpression Call(System.Reflection.MethodInfo method, System.Collections.Generic.IEnumerable<System.Linq.Expressions.Expression> arguments);
public static System.Linq.Expressions.MethodCallExpression Call(System.Reflection.MethodInfo method, System.Collections.Generic.IEnumerable<System.Linq.Expressions.Expression>? arguments);
static member Call : System.Reflection.MethodInfo * seq<System.Linq.Expressions.Expression> -> System.Linq.Expressions.MethodCallExpression
Public Shared Function Call (method As MethodInfo, arguments As IEnumerable(Of Expression)) As MethodCallExpression

Parametreler

method
MethodInfo

MethodInfo Hedef yöntemi temsil eden.

arguments
IEnumerable<Expression>

Çağrı bağımsız değişkenlerini temsil eden bir koleksiyonu Expression .

Döndürülenler

MethodCallExpression özelliğine CallNodeType eşit ve ve MethodObject özellikleri belirtilen değerlere ayarlanmış bir.

Şunlara uygulanır

Call(Expression, MethodInfo)

Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs

MethodCallExpression Bağımsız değişken içermeyen bir yönteme yapılan çağrıyı temsil eden bir oluşturur.

public:
 static System::Linq::Expressions::MethodCallExpression ^ Call(System::Linq::Expressions::Expression ^ instance, System::Reflection::MethodInfo ^ method);
public static System.Linq.Expressions.MethodCallExpression Call(System.Linq.Expressions.Expression instance, System.Reflection.MethodInfo method);
public static System.Linq.Expressions.MethodCallExpression Call(System.Linq.Expressions.Expression? instance, System.Reflection.MethodInfo method);
static member Call : System.Linq.Expressions.Expression * System.Reflection.MethodInfo -> System.Linq.Expressions.MethodCallExpression
Public Shared Function Call (instance As Expression, method As MethodInfo) As MethodCallExpression

Parametreler

instance
Expression

Bir Expression örnek yöntemi çağrısının örneğini belirten bir (Visual Basic'te )Shared yöntemi için static geçirinnull.

method
MethodInfo

Özelliğinin Method değerine eşit olarak ayarlanması için AMethodInfo.

Döndürülenler

MethodCallExpression özelliğine CallNodeType eşit ve ve MethodObject özellikleri belirtilen değerlere ayarlanmış bir.

Özel durumlar

method, null'e eşittir.

-veya-

instance method ve null bir örnek yöntemini temsil eder.

instance. türü, tarafından methodtemsil edilen yöntemin bildirim türüne atanamaz.

Örnekler

Aşağıdaki kod örneği, bağımsız değişken olmadan bir yöntemi çağıran bir ifadenin nasıl oluşturulacağını gösterir.

// Add the following directive to your file:
// using System.Linq.Expressions;

// This expression represents a call to an instance method without arguments.
Expression callExpr = Expression.Call(
    Expression.Constant("sample string"), typeof(String).GetMethod("ToUpper", new Type[] { }));

// Print out the expression.
Console.WriteLine(callExpr.ToString());

// The following statement first creates an expression tree,
// then compiles it, and then executes it.
Console.WriteLine(Expression.Lambda<Func<String>>(callExpr).Compile()());

// This code example produces the following output:
//
// "sample string".ToUpper
// SAMPLE STRING
' Add the following directive to your file:
' Imports System.Linq.Expressions   

' This expression represents a call to an instance method without arguments.
Dim callExpr As Expression = Expression.Call(
    Expression.Constant("sample string"), GetType(String).GetMethod("ToUpper", New Type() {}))

' Print the expression.
Console.WriteLine(callExpr.ToString())

' The following statement first creates an expression tree,
' then compiles it, and then executes it.  
Console.WriteLine(Expression.Lambda(Of Func(Of String))(callExpr).Compile()())

' This code example produces the following output:
'
' "sample string".ToUpper
' SAMPLE STRING

Açıklamalar

Bir (Shared Visual Basic'te) yöntemine yapılan çağrıyı temsil etmek static için, bu yöntemi çağırdığınızda parametresini instance geçirinnull.

Bir örnek yöntemini temsil ediyorsanız method , özelliğinin Typeinstance tarafından methodtemsil edilen yöntemin bildirim türüne atanabilir olması gerekir.

Sonuçta ArgumentsMethodCallExpression elde edilen özelliği boş. Type özelliği, tarafından methodtemsil edilen yöntemin dönüş türüne eşittir.

Şunlara uygulanır

Call(MethodInfo, Expression, Expression)

Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs
Kaynak:
MethodCallExpression.cs

MethodCallExpression İki bağımsız değişken alan statik bir yönteme yapılan çağrıyı temsil eden bir oluşturur.

public:
 static System::Linq::Expressions::MethodCallExpression ^ Call(System::Reflection::MethodInfo ^ method, System::Linq::Expressions::Expression ^ arg0, System::Linq::Expressions::Expression ^ arg1);
public static System.Linq.Expressions.MethodCallExpression Call(System.Reflection.MethodInfo method, System.Linq.Expressions.Expression arg0, System.Linq.Expressions.Expression arg1);
static member Call : System.Reflection.MethodInfo * System.Linq.Expressions.Expression * System.Linq.Expressions.Expression -> System.Linq.Expressions.MethodCallExpression
Public Shared Function Call (method As MethodInfo, arg0 As Expression, arg1 As Expression) As MethodCallExpression

Parametreler

method
MethodInfo

Özelliğinin Method değerine eşit olarak ayarlanması için AMethodInfo.

arg0
Expression

Expression İlk bağımsız değişkeni temsil eden.

arg1
Expression

Expression İkinci bağımsız değişkeni temsil eden.

Döndürülenler

MethodCallExpression özelliğine CallNodeType eşit ve ve MethodObject özellikleri belirtilen değerlere ayarlanmış bir.

Özel durumlar

method null değeridir.

Şunlara uygulanır