110,534
社区成员
发帖
与我相关
我的任务
分享
public async Task test()
{
await xxx();
}
private async Task GetUserAsync()
{
return await Task.Run(() =>
{
while(true)
{
if(a>b)
{
//在此处调用test应该如何调用
//使用await test(); 提示:
//The 'await' operator can only be used within an async lambda expression. Consider marking this lambda exp //ression with the 'async' modifier.
}
}
});
}
Task.Run(async () =>
{
await Task.FromResult(1);
});
private async Task GetUserAsync()
{
// 去掉await Task.Run(async() =>...
while (true)
{
if (a > b)
{
await test();
}
}
}