Func<T1,T2,T3,T4,T5,TResult> Func<T1,T2,T3,T4,T5,TResult> Func<T1,T2,T3,T4,T5,TResult> Func<T1,T2,T3,T4,T5,TResult> Delegate

定义

封装一个方法,该方法具有五个参数,并返回 TResult 参数所指定的类型的值。Encapsulates a method that has five parameters and returns a value of the type specified by the TResult parameter.

generic <typename T1, typename T2, typename T3, typename T4, typename T5, typename TResult>
public delegate TResult Func(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5);
public delegate TResult Func<in T1,in T2,in T3,in T4,in T5,out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5);
type Func<'T1, 'T2, 'T3, 'T4, 'T5, 'Result> = delegate of 'T1 * 'T2 * 'T3 * 'T4 * 'T5 -> 'Result
Public Delegate Function Func(Of In T1, In T2, In T3, In T4, In T5, Out TResult)(arg1 As T1, arg2 As T2, arg3 As T3, arg4 As T4, arg5 As T5) As TResult 

类型参数

T1

此委托封装的方法的第一个参数的类型。The type of the first parameter of the method that this delegate encapsulates.

T2

此委托封装的方法的第二个参数的类型。The type of the second parameter of the method that this delegate encapsulates.

T3

此委托封装的方法的第三个参数的类型。The type of the third parameter of the method that this delegate encapsulates.

T4

此委托封装的方法的第四个参数的类型。The type of the fourth parameter of the method that this delegate encapsulates.

T5

此委托封装的方法的第五个参数的类型。The type of the fifth parameter of the method that this delegate encapsulates.

TResult

此委托封装的方法的返回值类型。The type of the return value of the method that this delegate encapsulates.

参数

arg1

此委托封装的方法的第一个参数。The first parameter of the method that this delegate encapsulates.

arg2

此委托封装的方法的第二个参数。The second parameter of the method that this delegate encapsulates.

arg3

此委托封装的方法的第三个参数。The third parameter of the method that this delegate encapsulates.

arg4

此委托封装的方法的第四个参数。The fourth parameter of the method that this delegate encapsulates.

arg5

此委托封装的方法的第五个参数。The fifth parameter of the method that this delegate encapsulates.

返回值

TResult

此委托封装的方法的返回值。The return value of the method that this delegate encapsulates.

继承
Func<T1,T2,T3,T4,T5,TResult>Func<T1,T2,T3,T4,T5,TResult>Func<T1,T2,T3,T4,T5,TResult>Func<T1,T2,T3,T4,T5,TResult>

注解

可以使用此委托来表示可以作为参数传递而无需显式声明自定义委托的方法。You can use this delegate to represent a method that can be passed as a parameter without explicitly declaring a custom delegate. 封装的方法必须对应于此委托定义的方法签名。The encapsulated method must correspond to the method signature that is defined by this delegate. 这意味着,封装的方法必须具有五个参数,其中每个按值传递给它,并且它必须返回一个值。This means that the encapsulated method must have five parameters, each of which is passed to it by value, and that it must return a value.

备注

若要引用的方法,具有五个参数并返回void(或在 Visual Basic 中的声明为Sub而不是作为Function),使用泛型Action<T1,T2,T3,T4,T5>改为委托。To reference a method that has five parameters and returns void (or in Visual Basic, that is declared as a Sub rather than as a Function), use the generic Action<T1,T2,T3,T4,T5> delegate instead.

此外可以使用Func<T1,T2,T3,T4,T5,TResult>委托与匿名方法和 lambda 表达式。You can also use the Func<T1,T2,T3,T4,T5,TResult> delegate with anonymous methods and lambda expressions.

Lambda 表达式的基础类型是一个泛型Func委托。The underlying type of a lambda expression is one of the generic Func delegates. 这样,可以将 lambda 表达式作为参数传递而无需显式将其分配给委托。This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate.

扩展方法

GetMethodInfo(Delegate) GetMethodInfo(Delegate) GetMethodInfo(Delegate) GetMethodInfo(Delegate)

获取指示指定委托表示的方法的对象。Gets an object that represents the method represented by the specified delegate.

适用于

另请参阅