Język

Expression.GetFuncType(Type[]) Metoda

Definicja

Tworzy Type obiekt reprezentujący ogólny Func<TResult> typ delegata, który ma określone argumenty typu. Ostatni argument typu określa zwracany typ utworzonego delegata.

public:
 static Type ^ GetFuncType(... cli::array <Type ^> ^ typeArgs);
public static Type GetFuncType(params Type[] typeArgs);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Delegate creation requires dynamic code generation.")]
public static Type GetFuncType(params Type[]? typeArgs);
public static Type GetFuncType(params Type[]? typeArgs);
static member GetFuncType : Type[] -> Type
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Delegate creation requires dynamic code generation.")>]
static member GetFuncType : Type[] -> Type
Public Shared Function GetFuncType (ParamArray typeArgs As Type()) As Type

Parametry

typeArgs
Type[]

Tablica od jednego do siedmiu Type obiektów, które określają argumenty typu dla typu delegata System.Func .

Zwraca

Typ delegata Func<TResult> , który ma określone argumenty typu.

Atrybuty

Wyjątki

typeArgs zawiera mniej niż jeden lub więcej niż siedemnaście elementów.

Parametr typeArgs ma wartość null.

Uwagi

typeArgs musi zawierać co najmniej jeden i co najwyżej siedemnaście elementów.

Jeśli na przykład elementy typeArgs reprezentują typy T1…Tn, wynikowy obiekt Type reprezentuje skonstruowany typ delegata System.Func<T1,…,Tn> w języku C# lub System.Func(Of T1,…,Tn) w Visual Basic.

Dotyczy