24
1
using System;
2
using System.Threading.Tasks;
3
4
5
int sayi = 1;
6
7
if (await SayiyiKontrolEt(sayi, 1))
8
{
9
Console.WriteLine("bir");
10
}
11
if (await SayiyiKontrolEt(sayi, 2))
12
{
13
Console.WriteLine("iki");
14
}
15
Console.WriteLine("Program sonlandı!");
16
17
async Task<bool> SayiyiKontrolEt(int sayi, int olmasiGereken)
18
{
19
await Task.Delay(2000);
20
Console.WriteLine("Sayı kontrol ediliyor!");
21
return sayi == olmasiGereken;
22
}
23
24
Cached Result