c# async and await example

60

c# async and await example -

Live async and await the demontration of the image described in the source link.

async await c# -

// simple method structure
public static  Task<int> FooAsync(int num)
{
   num+=5;
   return Task.FromResult(num);
}
// calling function structure
public static async void Solve()
{
    var temp = await FooAsync(i);
}

Comments

Submit
0 Comments