EnumerableUtility.AsSet<T> method

Returns a set of the elements in the specified sequence.

public static ISet<T> AsSet<T>(this IEnumerable<T> source)
parameter description
T The type of element in the source sequence.
source The sequence.

Return Value

A set of elements.

Remarks

Unlike the ToHashSet method, if the original IEnumerable is an ISet{T} it will be returned as such (rather than copying to a new HashSet).

See Also