ParallelEnumerable.Union ParallelEnumerable.Union ParallelEnumerable.Union ParallelEnumerable.Union Method

Definition

Produces the set union of two parallel sequences.

Overloads

Union<TSource>(ParallelQuery<TSource>, IEnumerable<TSource>) Union<TSource>(ParallelQuery<TSource>, IEnumerable<TSource>) Union<TSource>(ParallelQuery<TSource>, IEnumerable<TSource>) Union<TSource>(ParallelQuery<TSource>, IEnumerable<TSource>)

This Union overload should never be called. This method is marked as obsolete and always throws NotSupportedException when called.

Union<TSource>(ParallelQuery<TSource>, ParallelQuery<TSource>) Union<TSource>(ParallelQuery<TSource>, ParallelQuery<TSource>) Union<TSource>(ParallelQuery<TSource>, ParallelQuery<TSource>) Union<TSource>(ParallelQuery<TSource>, ParallelQuery<TSource>)

Produces the set union of two parallel sequences by using the default equality comparer.

Union<TSource>(ParallelQuery<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>) Union<TSource>(ParallelQuery<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>) Union<TSource>(ParallelQuery<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>) Union<TSource>(ParallelQuery<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>)

This Union overload should never be called. This method is marked as obsolete and always throws NotSupportedException when called.

Union<TSource>(ParallelQuery<TSource>, ParallelQuery<TSource>, IEqualityComparer<TSource>) Union<TSource>(ParallelQuery<TSource>, ParallelQuery<TSource>, IEqualityComparer<TSource>) Union<TSource>(ParallelQuery<TSource>, ParallelQuery<TSource>, IEqualityComparer<TSource>) Union<TSource>(ParallelQuery<TSource>, ParallelQuery<TSource>, IEqualityComparer<TSource>)

Produces the set union of two parallel sequences by using a specified IEqualityComparer{T}.

Union<TSource>(ParallelQuery<TSource>, IEnumerable<TSource>) Union<TSource>(ParallelQuery<TSource>, IEnumerable<TSource>) Union<TSource>(ParallelQuery<TSource>, IEnumerable<TSource>) Union<TSource>(ParallelQuery<TSource>, IEnumerable<TSource>)

Warning

This API is now obsolete.

This Union overload should never be called. This method is marked as obsolete and always throws NotSupportedException when called.

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static System::Linq::ParallelQuery<TSource> ^ Union(System::Linq::ParallelQuery<TSource> ^ first, System::Collections::Generic::IEnumerable<TSource> ^ second);
[System.Obsolete("The second data source of a binary operator must be of type System.Linq.ParallelQuery<T> rather than System.Collections.Generic.IEnumerable<T>. To fix this problem, use the AsParallel() extension method to convert the right data source to System.Linq.ParallelQuery<T>.")]
public static System.Linq.ParallelQuery<TSource> Union<TSource> (this System.Linq.ParallelQuery<TSource> first, System.Collections.Generic.IEnumerable<TSource> second);
static member Union : System.Linq.ParallelQuery<'Source> * seq<'Source> -> System.Linq.ParallelQuery<'Source>
<Extension()>
Public Function Union(Of TSource) (first As ParallelQuery(Of TSource), second As IEnumerable(Of TSource)) As ParallelQuery(Of TSource)

Type Parameters

TSource

This type parameter is not used.

Parameters

second
IEnumerable<TSource>

This parameter is not used.

Returns

Exceptions

The exception that occurs when this method is called.

The query was canceled with the token passed in through WithCancellation.

One or more exceptions occurred during the evaluation of the query.

Remarks

This overload exists to disallow usage of Union with a left data source of type ParallelQuery<TSource> and a right data source of type IEnumerable<T>. Otherwise, the Union operator would appear to be binding to the parallel implementation, but would in reality bind to sequential implementation.

See also

Union<TSource>(ParallelQuery<TSource>, ParallelQuery<TSource>) Union<TSource>(ParallelQuery<TSource>, ParallelQuery<TSource>) Union<TSource>(ParallelQuery<TSource>, ParallelQuery<TSource>) Union<TSource>(ParallelQuery<TSource>, ParallelQuery<TSource>)

Produces the set union of two parallel sequences by using the default equality comparer.

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static System::Linq::ParallelQuery<TSource> ^ Union(System::Linq::ParallelQuery<TSource> ^ first, System::Linq::ParallelQuery<TSource> ^ second);
public static System.Linq.ParallelQuery<TSource> Union<TSource> (this System.Linq.ParallelQuery<TSource> first, System.Linq.ParallelQuery<TSource> second);
static member Union : System.Linq.ParallelQuery<'Source> * System.Linq.ParallelQuery<'Source> -> System.Linq.ParallelQuery<'Source>
<Extension()>
Public Function Union(Of TSource) (first As ParallelQuery(Of TSource), second As ParallelQuery(Of TSource)) As ParallelQuery(Of TSource)

Type Parameters

TSource

The type of the elements of the input sequences.

Parameters

first
ParallelQuery<TSource> ParallelQuery<TSource> ParallelQuery<TSource> ParallelQuery<TSource>

A sequence whose distinct elements form the first set for the union.

second
ParallelQuery<TSource> ParallelQuery<TSource> ParallelQuery<TSource> ParallelQuery<TSource>

A sequence whose distinct elements form the second set for the union.

Returns

A sequence that contains the elements from both input sequences, excluding duplicates.

Exceptions

first or second is a null reference (Nothing in Visual Basic).

The query was canceled with the token passed in through WithCancellation.

One or more exceptions occurred during the evaluation of the query.

See also

Union<TSource>(ParallelQuery<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>) Union<TSource>(ParallelQuery<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>) Union<TSource>(ParallelQuery<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>) Union<TSource>(ParallelQuery<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>)

Warning

This API is now obsolete.

This Union overload should never be called. This method is marked as obsolete and always throws NotSupportedException when called.

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static System::Linq::ParallelQuery<TSource> ^ Union(System::Linq::ParallelQuery<TSource> ^ first, System::Collections::Generic::IEnumerable<TSource> ^ second, System::Collections::Generic::IEqualityComparer<TSource> ^ comparer);
[System.Obsolete("The second data source of a binary operator must be of type System.Linq.ParallelQuery<T> rather than System.Collections.Generic.IEnumerable<T>. To fix this problem, use the AsParallel() extension method to convert the right data source to System.Linq.ParallelQuery<T>.")]
public static System.Linq.ParallelQuery<TSource> Union<TSource> (this System.Linq.ParallelQuery<TSource> first, System.Collections.Generic.IEnumerable<TSource> second, System.Collections.Generic.IEqualityComparer<TSource> comparer);
static member Union : System.Linq.ParallelQuery<'Source> * seq<'Source> * System.Collections.Generic.IEqualityComparer<'Source> -> System.Linq.ParallelQuery<'Source>
<Extension()>
Public Function Union(Of TSource) (first As ParallelQuery(Of TSource), second As IEnumerable(Of TSource), comparer As IEqualityComparer(Of TSource)) As ParallelQuery(Of TSource)

Type Parameters

TSource

This type parameter is not used.

Parameters

second
IEnumerable<TSource>

This parameter is not used.

comparer
IEqualityComparer<TSource>

This parameter is not used.

Returns

Exceptions

The exception that occurs when this method is called.

The query was canceled with the token passed in through WithCancellation.

One or more exceptions occurred during the evaluation of the query.

Remarks

This overload exists to disallow usage of Union with a left data source of type ParallelQuery<TSource> and a right data source of type IEnumerable<T>. Otherwise, the Union operator would appear to be binding to the parallel implementation, but would in reality bind to the sequential implementation.

See also

Union<TSource>(ParallelQuery<TSource>, ParallelQuery<TSource>, IEqualityComparer<TSource>) Union<TSource>(ParallelQuery<TSource>, ParallelQuery<TSource>, IEqualityComparer<TSource>) Union<TSource>(ParallelQuery<TSource>, ParallelQuery<TSource>, IEqualityComparer<TSource>) Union<TSource>(ParallelQuery<TSource>, ParallelQuery<TSource>, IEqualityComparer<TSource>)

Produces the set union of two parallel sequences by using a specified IEqualityComparer{T}.

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static System::Linq::ParallelQuery<TSource> ^ Union(System::Linq::ParallelQuery<TSource> ^ first, System::Linq::ParallelQuery<TSource> ^ second, System::Collections::Generic::IEqualityComparer<TSource> ^ comparer);
public static System.Linq.ParallelQuery<TSource> Union<TSource> (this System.Linq.ParallelQuery<TSource> first, System.Linq.ParallelQuery<TSource> second, System.Collections.Generic.IEqualityComparer<TSource> comparer);
static member Union : System.Linq.ParallelQuery<'Source> * System.Linq.ParallelQuery<'Source> * System.Collections.Generic.IEqualityComparer<'Source> -> System.Linq.ParallelQuery<'Source>
<Extension()>
Public Function Union(Of TSource) (first As ParallelQuery(Of TSource), second As ParallelQuery(Of TSource), comparer As IEqualityComparer(Of TSource)) As ParallelQuery(Of TSource)

Type Parameters

TSource

The type of the elements of the input sequences.

Parameters

first
ParallelQuery<TSource> ParallelQuery<TSource> ParallelQuery<TSource> ParallelQuery<TSource>

A sequence whose distinct elements form the first set for the union.

second
ParallelQuery<TSource> ParallelQuery<TSource> ParallelQuery<TSource> ParallelQuery<TSource>

A sequence whose distinct elements form the second set for the union.

comparer
IEqualityComparer<TSource>

An IEqualityComparer<T> to compare values.

Returns

A sequence that contains the elements from both input sequences, excluding duplicates.

Exceptions

first or second is a null reference (Nothing in Visual Basic).

The query was canceled with the token passed in through WithCancellation.

One or more exceptions occurred during the evaluation of the query.

See also

Applies to