Redigera

Dela via


Expression.GetFuncType(Type[]) Method

Definition

Creates a Type object that represents a generic Func<TResult> delegate type that has specific type arguments. The last type argument specifies the return type of the created delegate.

public:
 static Type ^ GetFuncType(... cli::array <Type ^> ^ typeArgs);
public static Type GetFuncType (params Type[] typeArgs);
public static Type GetFuncType (params Type[]? typeArgs);
static member GetFuncType : Type[] -> Type
Public Shared Function GetFuncType (ParamArray typeArgs As Type()) As Type

Parameters

typeArgs
Type[]

An array of one to seventeen Type objects that specify the type arguments for the System.Func delegate type.

Returns

The type of a Func<TResult> delegate that has the specified type arguments.

Exceptions

typeArgs contains fewer than one or more than seventeen elements.

typeArgs is null.

Remarks

typeArgs must contain at least one and at most seventeen elements.

As an example, if the elements of typeArgs represent the types T1…Tn, the resulting Type object represents the constructed delegate type System.Func<T1,…,Tn> in C# or System.Func(Of T1,…,Tn) in Visual Basic.

Applies to