📜  c# 返回任务列表 - C# 代码示例

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

代码示例1
private async Task> GetListAsync(){
      //Create a list object and assign it to a new task
      //which returns your list object
    List list = await Task.Run(() => manager.GetList());
  
      return list;
  
      //Or you may just need to await something and just return a list
    await SomeMethod();
    List list1 = new List();
 
    return list;
}