{TOC}
| Namespace: | System.Linq |
| Assembly: | System.Core.dll |
| Extends: | IEnumerable<T> |
Back to
Standard Query Operator IndexEditIntroduction
The All operator checks whether all elements of a sequence satisfy a condition.
EditMethod Signatures
public static bool All<TSource>(
this IEnumerable<TSource> source,
Func<TSource, bool> predicate)EditExceptions
Throws an ArgumentNullException if
source or
predicate is null.
EditPseudo-code
If
source is null, throw an ArgumentNullException.
If
predicate is null, throw an ArgumentNullException.
Iterate the
source sequence
If predicate( this element ) is false, return false immediately.
Return true only if all elements pass the predicate function (i.e. we fell through the loop).
EditLoop Count
< 1 if the predicate fails, otherwise 1.
EditCode Samples
TODO:Needs code sample.