ImmutableHashSet.Create Method

Definition

Overloads

Create<T>()

Creates an empty immutable hash set.

Create<T>(IEqualityComparer<T>)

Creates an empty immutable hash set that uses the specified equality comparer.

Create<T>(ReadOnlySpan<T>)

Creates a new immutable collection prefilled with the specified items.

Create<T>(T)

Creates a new immutable hash set that contains the specified item.

Create<T>(T[])

Creates a new immutable hash set that contains the specified array of items.

Create<T>(IEqualityComparer<T>, ReadOnlySpan<T>)

Creates a new immutable collection prefilled with the specified items.

Create<T>(IEqualityComparer<T>, T)

Creates a new immutable hash set that contains the specified item and uses the specified equality comparer for the set type.

Create<T>(IEqualityComparer<T>, T[])

Creates a new immutable hash set that contains the items in the specified collection and uses the specified equality comparer for the set type.

Create<T>()

Source:
ImmutableHashSet.cs
Source:
ImmutableHashSet.cs
Source:
ImmutableHashSet.cs

Creates an empty immutable hash set.

public:
generic <typename T>
 static System::Collections::Immutable::ImmutableHashSet<T> ^ Create();
public static System.Collections.Immutable.ImmutableHashSet<T> Create<T> ();
static member Create : unit -> System.Collections.Immutable.ImmutableHashSet<'T>
Public Function Create(Of T) () As ImmutableHashSet(Of T)

Type Parameters

T

The type of items to be stored in the immutable hash set.

Returns

An empty immutable hash set.

Applies to

Create<T>(IEqualityComparer<T>)

Source:
ImmutableHashSet.cs
Source:
ImmutableHashSet.cs
Source:
ImmutableHashSet.cs

Creates an empty immutable hash set that uses the specified equality comparer.

public:
generic <typename T>
 static System::Collections::Immutable::ImmutableHashSet<T> ^ Create(System::Collections::Generic::IEqualityComparer<T> ^ equalityComparer);
public static System.Collections.Immutable.ImmutableHashSet<T> Create<T> (System.Collections.Generic.IEqualityComparer<T> equalityComparer);
public static System.Collections.Immutable.ImmutableHashSet<T> Create<T> (System.Collections.Generic.IEqualityComparer<T>? equalityComparer);
static member Create : System.Collections.Generic.IEqualityComparer<'T> -> System.Collections.Immutable.ImmutableHashSet<'T>
Public Function Create(Of T) (equalityComparer As IEqualityComparer(Of T)) As ImmutableHashSet(Of T)

Type Parameters

T

The type of items in the immutable hash set.

Parameters

equalityComparer
IEqualityComparer<T>

The object to use for comparing objects in the set for equality.

Returns

An empty immutable hash set.

Applies to

Create<T>(ReadOnlySpan<T>)

Source:
ImmutableHashSet.cs
Source:
ImmutableHashSet.cs

Creates a new immutable collection prefilled with the specified items.

public:
generic <typename T>
 static System::Collections::Immutable::ImmutableHashSet<T> ^ Create(ReadOnlySpan<T> items);
public static System.Collections.Immutable.ImmutableHashSet<T> Create<T> (ReadOnlySpan<T> items);
static member Create : ReadOnlySpan<'T> -> System.Collections.Immutable.ImmutableHashSet<'T>
Public Function Create(Of T) (items As ReadOnlySpan(Of T)) As ImmutableHashSet(Of T)

Type Parameters

T

The type of items stored by the collection.

Parameters

items
ReadOnlySpan<T>

The items to prepopulate.

Returns

The new immutable collection.

Applies to

Create<T>(T)

Source:
ImmutableHashSet.cs
Source:
ImmutableHashSet.cs
Source:
ImmutableHashSet.cs

Creates a new immutable hash set that contains the specified item.

public:
generic <typename T>
 static System::Collections::Immutable::ImmutableHashSet<T> ^ Create(T item);
public static System.Collections.Immutable.ImmutableHashSet<T> Create<T> (T item);
static member Create : 'T -> System.Collections.Immutable.ImmutableHashSet<'T>
Public Function Create(Of T) (item As T) As ImmutableHashSet(Of T)

Type Parameters

T

The type of items in the immutable hash set.

Parameters

item
T

The item to prepopulate the hash set with.

Returns

A new immutable hash set that contains the specified item.

Applies to

Create<T>(T[])

Source:
ImmutableHashSet.cs
Source:
ImmutableHashSet.cs
Source:
ImmutableHashSet.cs

Creates a new immutable hash set that contains the specified array of items.

public:
generic <typename T>
 static System::Collections::Immutable::ImmutableHashSet<T> ^ Create(... cli::array <T> ^ items);
public static System.Collections.Immutable.ImmutableHashSet<T> Create<T> (params T[] items);
static member Create : 'T[] -> System.Collections.Immutable.ImmutableHashSet<'T>
Public Function Create(Of T) (ParamArray items As T()) As ImmutableHashSet(Of T)

Type Parameters

T

The type of items in the immutable hash set.

Parameters

items
T[]

An array that contains the items to prepopulate the hash set with.

Returns

A new immutable hash set that contains the specified items.

Applies to

Create<T>(IEqualityComparer<T>, ReadOnlySpan<T>)

Source:
ImmutableHashSet.cs
Source:
ImmutableHashSet.cs

Creates a new immutable collection prefilled with the specified items.

public:
generic <typename T>
 static System::Collections::Immutable::ImmutableHashSet<T> ^ Create(System::Collections::Generic::IEqualityComparer<T> ^ equalityComparer, ReadOnlySpan<T> items);
public static System.Collections.Immutable.ImmutableHashSet<T> Create<T> (System.Collections.Generic.IEqualityComparer<T>? equalityComparer, ReadOnlySpan<T> items);
static member Create : System.Collections.Generic.IEqualityComparer<'T> * ReadOnlySpan<'T> -> System.Collections.Immutable.ImmutableHashSet<'T>
Public Function Create(Of T) (equalityComparer As IEqualityComparer(Of T), items As ReadOnlySpan(Of T)) As ImmutableHashSet(Of T)

Type Parameters

T

The type of items stored by the collection.

Parameters

equalityComparer
IEqualityComparer<T>

The equality comparer.

items
ReadOnlySpan<T>

The items to prepopulate.

Returns

The new immutable collection.

Applies to

Create<T>(IEqualityComparer<T>, T)

Source:
ImmutableHashSet.cs
Source:
ImmutableHashSet.cs
Source:
ImmutableHashSet.cs

Creates a new immutable hash set that contains the specified item and uses the specified equality comparer for the set type.

public:
generic <typename T>
 static System::Collections::Immutable::ImmutableHashSet<T> ^ Create(System::Collections::Generic::IEqualityComparer<T> ^ equalityComparer, T item);
public static System.Collections.Immutable.ImmutableHashSet<T> Create<T> (System.Collections.Generic.IEqualityComparer<T> equalityComparer, T item);
public static System.Collections.Immutable.ImmutableHashSet<T> Create<T> (System.Collections.Generic.IEqualityComparer<T>? equalityComparer, T item);
static member Create : System.Collections.Generic.IEqualityComparer<'T> * 'T -> System.Collections.Immutable.ImmutableHashSet<'T>
Public Function Create(Of T) (equalityComparer As IEqualityComparer(Of T), item As T) As ImmutableHashSet(Of T)

Type Parameters

T

The type of items in the immutable hash set.

Parameters

equalityComparer
IEqualityComparer<T>

The object to use for comparing objects in the set for equality.

item
T

The item to prepopulate the hash set with.

Returns

A new immutable hash set that contains the specified item.

Applies to

Create<T>(IEqualityComparer<T>, T[])

Source:
ImmutableHashSet.cs
Source:
ImmutableHashSet.cs
Source:
ImmutableHashSet.cs

Creates a new immutable hash set that contains the items in the specified collection and uses the specified equality comparer for the set type.

public:
generic <typename T>
 static System::Collections::Immutable::ImmutableHashSet<T> ^ Create(System::Collections::Generic::IEqualityComparer<T> ^ equalityComparer, ... cli::array <T> ^ items);
public static System.Collections.Immutable.ImmutableHashSet<T> Create<T> (System.Collections.Generic.IEqualityComparer<T> equalityComparer, params T[] items);
public static System.Collections.Immutable.ImmutableHashSet<T> Create<T> (System.Collections.Generic.IEqualityComparer<T>? equalityComparer, params T[] items);
static member Create : System.Collections.Generic.IEqualityComparer<'T> * 'T[] -> System.Collections.Immutable.ImmutableHashSet<'T>
Public Function Create(Of T) (equalityComparer As IEqualityComparer(Of T), ParamArray items As T()) As ImmutableHashSet(Of T)

Type Parameters

T

The type of items stored in the immutable hash set.

Parameters

equalityComparer
IEqualityComparer<T>

The object to use for comparing objects in the set for equality.

items
T[]

An array that contains the items to prepopulate the hash set with.

Returns

A new immutable hash set that contains the specified items.

Applies to