Add a C# course with a side-by-side code runner.

Each lesson explains a topic and runs the edited program next to the text through the local .NET SDK.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
pepaskopec-blip 2026-10-11 14:37:14 +02:00
commit 333085ee53
86 changed files with 2482 additions and 5 deletions

View file

@ -0,0 +1,34 @@
---
id: cs-4-delegaty
nazev: Delegáty
popis: Proměnná, do které uložíte metodu.
---
# Výklad
## Func
*funkce*
- Func<int, int> je metoda, která dostane int a vrátí int.
- x => x * x je taková metoda bez jména.
- Do proměnné ji uložíte a zavoláte později.
> Tip: Závorky pocet(4) metodu spustí. Bez nich byste ji jen předali dál.
## Action
*bez výsledku*
- Action nic nevrací. Hodí se na kroky.
- Metodu můžete předat jiné metodě jako argument.
- Tak se píše i Where z minulé lekce.
> Tip: Vyměňte x * x za x + 1.
# Kód
```
Func<int, int> pocet = x => x * x;
Console.WriteLine(pocet(4));
Action pozdrav = () => Console.WriteLine("ahoj");
pozdrav();
```