Expression.GetFuncType(Type[]) 方法

定义

创建一个 Type 对象,该对象表示具有特定类型参数的泛型 Func<TResult> 委托类型。 最后一个类型参数指定已创建委托的返回类型。

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

参数

typeArgs
Type[]

包含一到十七个 Type 对象的数组,它指定 System.Func 委托类型的类型参数。

返回

Type

具有指定类型参数的 Func<TResult> 委托的类型。

例外

typeArgs 包含少于一个或多于十七个的元素。

typeArgsnull

注解

typeArgs 必须至少包含一个和至少十七个元素。

例如,如果表示类型的元素typeArgs,则生成的Type对象表示 C# 或 System.Func(Of T1,…,Tn) Visual Basic 中构造的委托类型System.Func<T1,…,Tn>T1…Tn

适用于