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 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.