Func delegate with no return type
Func delegate with no return type
Func delegate with no return type
Re: Func delegate with no return type
All Func delegates return something; all the Action delegates return void.
`Func` takes no arguments and returns TResult:
```
public delegate TResult Func()
```
`Action` takes one argument and does not return a value:
```
public delegate void Action(T obj)
```
`Action` is the simplest, 'bare' delegate:
```
public delegate void Action()
```
There's also `Func` and `Action` (and others up to 16 arguments). All of these (except for `Action`) are new to .NET 3.5 (defined in System.Core).
`Func` takes no arguments and returns TResult:
```
public delegate TResult Func()
```
`Action` takes one argument and does not return a value:
```
public delegate void Action(T obj)
```
`Action` is the simplest, 'bare' delegate:
```
public delegate void Action()
```
There's also `Func` and `Action` (and others up to 16 arguments). All of these (except for `Action`) are new to .NET 3.5 (defined in System.Core).