public SPListItemCollection GetACollection()
{
try
{
//Method to get an item collection from somewhere
if(itemCol != null)
return itemCol;
else
return null;
}
catch(Exception ex)
{
LogException(ex);
return null;
}
}
此方法必须返回 null(不是空列表)——无论是否捕获到异常。上述工作 - 但有没有更好的方法呢?