【发布时间】:2015-02-16 04:04:12
【问题描述】:
我有这个代码:
static void Main(string[] args)
{
Func<Task<string>> getWordAsync = async () => "hello";
Console.WriteLine(getWordAsync());
Console.ReadLine();
}
取自this 书。如果这不打印:
"hello"
代替:
System.Threading.Tasks.Task`1[System.String]
【问题讨论】:
-
lambda 按预期工作。 async lambda的返回值是一个封装了异步操作的Task
标签: c# .net lambda async-await c#-5.0