ImmutableHashSet
Provides a set of initialization methods for instances of the ImmutableHashSet<T> class.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
Creates an empty immutable hash set.
Creates an empty immutable hash set that uses the specified equality comparer.
Creates a new immutable hash set that contains the specified item.
Creates a new immutable hash set that contains the specified item and uses the specified equality comparer for the set type.
Creates a new immutable hash set that contains the specified array of items.
Creates a new immutable hash set that contains the items in the specified collection and uses the specified equality comparer for the set type.
Creates a new immutable hash set builder.
Creates a new immutable hash set builder.
Creates a new immutable hash set prefilled with the specified items.
public static ImmutableHashSet<T> CreateRange<T>(IEqualityComparer<T> equalityComparer, IEnumerable<T> items)
Creates a new immutable hash set that contains the specified items and uses the specified equality comparer for the set type.
public static ImmutableHashSet<TSource> ToImmutableHashSet<TSource>(this IEnumerable<TSource> source, IEqualityComparer<TSource> equalityComparer)
Enumerates a sequence, produces an immutable hash set of its contents, and uses the specified equality comparer for the set type.
public static ImmutableHashSet<TSource> ToImmutableHashSet<TSource>(this IEnumerable<TSource> source)
Enumerates a sequence and produces an immutable hash set of its contents.