File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1111This can be useful for many purposes, and is called [ "delegates"] ( https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/delegates/ ) in C#.
1212We explain its basics below, and refer to [ the sorting lecture] ( ./lectures/misc/sorting ) for an example of how it can be used.
1313
14- ## Action -- In short
14+ ## Definition
1515
1616[ An * action* is] ( https://learn.microsoft.com/en-us/dotnet/api/system.action?view=net-9.0 )
1717
@@ -36,6 +36,8 @@ We can call those easily:
3636!include`snippetStart="// We can call our methods directly:", snippetEnd="// Or we can store them"` code/projects/Actions/Actions/Program.cs
3737```
3838
39+ ## Manipulating Actions as Variables
40+
3941We can also store them into variables and then call them:
4042
4143```
@@ -44,7 +46,7 @@ We can also store them into variables and then call them:
4446
4547As we can see, ` ExampleActions.Display ` is of type ` Action<int> ` since the ` Display ` method takes an ` int ` as argument.
4648
47- ## Action as Parameter
49+ ## Action as Parameters
4850
4951Method can take actions as parameter:
5052
You can’t perform that action at this time.
0 commit comments