In the documentation, I find methods with arguments which seem unused. In the code examples, Any() with 1 argument Any<TSource>(IEnumerable<TSource>)
is called with no arguments:
bool hasElements = numbers.Any();
and Any() with 2 arguments Any<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)
is used with the second argument only:
bool unvaccinated = pets.Any(p => p.Age > 1 && p.Vaccinated == false)
What is the meaning of the first argument (here: IEnumerable<TSource>
) in the documentation? I guess it is related to the object on which the method is called, but how does this syntax work?