Func Delegates

Several of the Standard Query Operators are prototyped to take a Func delegate as an argument. This prevents you from having to explicitly declare delegate types. Here are the Func delegate declarations:

public delegate TR Func<TR>();
public delegate TR Func<T0, TR>(T0 a0);
public delegate TR Func<T0, T1, TR>(T0 a0, T1 a1);
public delegate TR Func<T0, T1, T2, TR>(T0 a0, T1 a1, T2 a2);
public delegate TR Func<T0, T1, T2, T3, TR>(T0 a0, T1 a1, T2 a2, T3 a3);

In each declaration, TR refers to the data type returned. Notice that the return type argument, TR, is at the end of the parameter type template for every overload of the Func delegate. The other type parameters, T0, T1, T2, and T3, refer to the input parameters passed to the ...

Get Pro LINQ: Language Integrated Query in C# 2008 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.