Skip to content
CShift0.32

Action

Struct · built-in type

struct Action

A function value without a result: Action<int, string> takes an int and a string. Up to 8 parameters.

Action<string> log = s => Console.WriteLine("log: " + s);
log("started");

A function, a lambda or a closure (it captures read-only copies) can be assigned to it; without captures it is a plain C function pointer. See the language guide (functions).

Name Description
Invoke Calls the function (the same as f(...)).
void Invoke(...)

Calls the function (the same as f(...)).