Expression.GetFuncType(Type[]) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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);
[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
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.
- Attributes
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.