Skip to content

Commit d6bdcee

Browse files
committed
Improving action notes.
1 parent b8c74a9 commit d6bdcee

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

source/lectures/misc/actions.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ tags:
1111
This can be useful for many purposes, and is called ["delegates"](https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/delegates/) in C#.
1212
We 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+
3941
We 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

4547
As 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

4951
Method can take actions as parameter:
5052

0 commit comments

Comments
 (0)