Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Contract.Exists<T> Method (IEnumerable<T>, Predicate<T>)

Determines whether an element within a collection of elements exists within a function.

Namespace:  System.Diagnostics.Contracts
Assembly:  mscorlib (in mscorlib.dll)
public static bool Exists<T>(
	IEnumerable<T> collection,
	Predicate<T> predicate
)

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.Boolean
true if and only if predicate returns true for any element of type T in collection.
ExceptionCondition
ArgumentNullException

collection or predicate is null.

Silverlight

Supported in: 5, 4

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.