我可以在VB中實現以下C#代碼片段,但它看起來非常笨重,因爲我執行Linq查詢來獲取相關用戶的事件。有一條整潔的道路嗎?C#VB問題
ctx.FetchEventsForWhichCurrentUserIsRegistered((op) =>
{
if (!op.HasError)
{
var items = op.Value;
_currentUserRegisteredEventIds = new HashSet<int>(items);
UpdateRegistrationButtons();
}
}, null);
}
else
{
_currentUserRegisteredEventIds = null;
UpdateRegistrationButtons();
}
什麼版本的.Net? vb支持.Net 4/vs2010中的多行lambdas。 – 2010-06-09 16:36:12
.NET 4.我的問題是,我不明白var items = op.value指的是什麼。 – Jim 2010-06-10 09:05:11