ParallelEnumerable.Any<TSource> Method (ParallelQuery<TSource>)
Determines whether a parallel sequence contains any elements.
Assembly: System.Core (in System.Core.dll)
The type of elements of source.
- Type: System.Linq.ParallelQuery<>
The sequence to check for emptiness.
Return ValueType: System.Boolean
true if the source sequence contains any elements; otherwise, false.
Usage NoteIn Visual Basic and C#, you can call this method as an instance method on any object of type ParallelQuery<>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
This overload of the Any method causes a fully-buffered merge to be performed before the result is returned. The merge behavior can impact performance or cause an out of memory exception in large enumerables. To avoid the merge behavior, use the overload of Any that takes a Func parameter, or else use an alternative method such as FirstOrDefault.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.