📜  getawaiter 并且没有扩展方法 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:56.010000             🧑  作者: Mango

代码示例2
//How to Apply async & await in C#
private async Task> GetBigListAsync()
{
    var myTask = Task.Run( () => GetBigList());
    // your thread is free to do other useful stuff right nw
    DoOtherUsefulStuff();
    // after a while you need the result, await for myTask:
    List result = await myTask;

    // you can now use the results of loading:
    ProcessResult(result);
    return result;
}