Contract.Exists<T> Method (IEnumerable<T>, Predicate<T>)
Silverlight
Determines whether an element within a collection of elements exists within a function.
Namespace: System.Diagnostics.Contracts
Assembly: mscorlib (in mscorlib.dll)
Type Parameters
- T
The type that is contained in collection.
Parameters
- collection
- Type: System.Collections.Generic.IEnumerable<T>
The collection from which elements of type T will be drawn to pass to predicate.
- predicate
- Type: System.Predicate<T>
The function to evaluate for an element in collection.
Return Value
Type: System.Booleantrue if and only if predicate returns true for any element of type T in collection.
| Exception | Condition |
|---|---|
| ArgumentNullException | collection or predicate is null. |
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.