我有一个方法需要返回布尔值,在我的方法中我需要进行异步调用来决定返回 true 还是 false。我试图将 return 语句放在 lambda 表达式中,但它会抛出一个return type is 'void'错误
bool method()
{
domaincontext.Load(domaincontext.GetXXX(),
loadOperation =>
{
value = ???
}, null);
return value;
}