Click or drag to resize
AlgorithmsSetUnionT Method (IEnumerableT, IEnumerableT)
Computes the set-theoretic union of two collections. The union of two sets is all items that appear in either of the sets. If an item appears X times in one set, and Y times in the other set, the union contains the item Maximum(X,Y) times. The source collections are not changed. A new collection is created with the union of the collections; the order of the items in this collection is undefined.

Namespace: X3Platform.Collections
Assembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntax
public static IEnumerable<T> SetUnion<T>(
	IEnumerable<T> collection1,
	IEnumerable<T> collection2
)

Parameters

collection1
Type: System.Collections.GenericIEnumerableT
The first collection to union.
collection2
Type: System.Collections.GenericIEnumerableT
The second collection to union.

Type Parameters

T

[Missing <typeparam name="T"/> documentation for "M:X3Platform.Collections.Algorithms.SetUnion``1(System.Collections.Generic.IEnumerable{``0},System.Collections.Generic.IEnumerable{``0})"]

Return Value

Type: IEnumerableT
The union of the two collections, considered as sets.
Exceptions
ExceptionCondition
ArgumentNullExceptioncollection1 or collection2 is null.
Remarks

When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the two equal items.

The default sense of equality for T is used, as defined by T's implementation of IComparable<T>.Equals or object.Equals.

If both collections are Set, Bag, OrderedSet, or OrderedBag collections, it is more efficient to use the Union or UnionWith methods on that class.

See Also