Contract::Exists<T> Method (IEnumerable<T>^, Predicate<T>^)
.NET Framework (current version)
Determines whether an element within a collection of elements exists within a function.
Assembly: mscorlib (in mscorlib.dll)
public: generic<typename T> static bool Exists( IEnumerable<T>^ collection, Predicate<T>^ predicate )
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.
Type Parameters
- T
The type that is contained in collection.
| Exception | Condition |
|---|---|
| ArgumentNullException | collection or predicate is null. |
Universal Windows Platform
Available since 8
.NET Framework
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 4.0
Windows Phone Silverlight
Available since 8.0
Windows Phone
Available since 8.1
Available since 8
.NET Framework
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 4.0
Windows Phone Silverlight
Available since 8.0
Windows Phone
Available since 8.1
Show: