The All
method[
^] verifies that all elements in the source collection match a particular predicate. It doesn't make any sense to call it without a predicate, so there isn't an overload to do that.
It's possible that you meant to call
the Any
method[
^], which
does have an overload without a predicate. However, given the code you've posted, you don't need to call any method; just use the
foreach
loop:
var anchors = html.DocumentNode.Descendants("A");
foreach (var a in anchors)
{
...
}
EDIT:
To return all of the anchors, you'll either need to change the method to return a list of strings, or combine the strings using a separator:
var result = new List<string>();
while (reader.Read())
{
string bottom = reader.GetString(1);
int index = bottom.IndexOf("picks", StringComparison.OrdinalIgnoreCase);
if (index != -1)
{
var html = new HtmlDocument();
html.LoadHtml(bottom);
var anchors = html.DocumentNode.Descendants("A");
foreach (var a in anchors)
{
result.Add(a.OuterHtml);
}
}
}
return result;
return string.Join(Environment.NewLine, result);
return string.Join(Environment.NewLine, result.ToArray());