0
我使用IIS中託管的WCF從在線獲取數據。我決定用this的例子來處理我所有的錯誤。在我的代碼,我使用的是需要被放置在一個正確的方式ClientContext類如何在wcf中配置客戶端上下文(sharepoint online)?
ClientContext _context = new ClientContext(_url);
var list = _context.Web.Lists.GetByTitle(ListName);
ListItem item = list.GetItemById(id);
_context.Load(item, i => i[Description], i => i[Picture], i => i[Title], i => i.Id);
_context.ExecuteQuery();
_context.Dispose();
但如果我例外_context.ExecuteQuery();我去的HandleError方法
public bool HandleError(Exception error)
{
return true;
}
的問題是:如何處理客戶端上下文在這種情況呢?