Answers for "async await in nutshell"

C#
4

async await in nutshell

// 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);
}
Posted by: Guest on April-30-2022

C# Answers by Framework

Browse Popular Code Answers by Language