ImmutableDictionary.CreateRange Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
CreateRange<TKey,TValue>(IEnumerable<KeyValuePair<TKey,TValue>>) |
Creates a new immutable dictionary that contains the specified items. |
CreateRange<TKey,TValue>(IEqualityComparer<TKey>, IEnumerable<KeyValuePair<TKey,TValue>>) |
Creates a new immutable dictionary that contains the specified items and uses the specified key comparer. |
CreateRange<TKey,TValue>(IEqualityComparer<TKey>, IEqualityComparer<TValue>, IEnumerable<KeyValuePair<TKey,TValue>>) |
Creates a new immutable dictionary that contains the specified items and uses the specified key comparer. |
- Source:
- ImmutableDictionary.cs
- Source:
- ImmutableDictionary.cs
- Source:
- ImmutableDictionary.cs
- Source:
- ImmutableDictionary.cs
Creates a new immutable dictionary that contains the specified items.
public:
generic <typename TKey, typename TValue>
static System::Collections::Immutable::ImmutableDictionary<TKey, TValue> ^ CreateRange(System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<TKey, TValue>> ^ items);
public static System.Collections.Immutable.ImmutableDictionary<TKey,TValue> CreateRange<TKey,TValue>(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>> items);
static member CreateRange : seq<System.Collections.Generic.KeyValuePair<'Key, 'Value>> -> System.Collections.Immutable.ImmutableDictionary<'Key, 'Value>
Public Function CreateRange(Of TKey, TValue) (items As IEnumerable(Of KeyValuePair(Of TKey, TValue))) As ImmutableDictionary(Of TKey, TValue)
Type Parameters
- TKey
The type of keys in the dictionary.
- TValue
The type of values in the dictionary.
Parameters
- items
- IEnumerable<KeyValuePair<TKey,TValue>>
The items used to populate the dictionary before it's immutable.
Returns
A new immutable dictionary that contains the specified items.
Applies to
.NET 9 and other versions
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9 |
.NET Framework | 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided) |
.NET Standard | 2.0 (package-provided) |
UWP | 10.0 |
- Source:
- ImmutableDictionary.cs
- Source:
- ImmutableDictionary.cs
- Source:
- ImmutableDictionary.cs
- Source:
- ImmutableDictionary.cs
Creates a new immutable dictionary that contains the specified items and uses the specified key comparer.
public:
generic <typename TKey, typename TValue>
static System::Collections::Immutable::ImmutableDictionary<TKey, TValue> ^ CreateRange(System::Collections::Generic::IEqualityComparer<TKey> ^ keyComparer, System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<TKey, TValue>> ^ items);
public static System.Collections.Immutable.ImmutableDictionary<TKey,TValue> CreateRange<TKey,TValue>(System.Collections.Generic.IEqualityComparer<TKey> keyComparer, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>> items);
public static System.Collections.Immutable.ImmutableDictionary<TKey,TValue> CreateRange<TKey,TValue>(System.Collections.Generic.IEqualityComparer<TKey>? keyComparer, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>> items);
static member CreateRange : System.Collections.Generic.IEqualityComparer<'Key> * seq<System.Collections.Generic.KeyValuePair<'Key, 'Value>> -> System.Collections.Immutable.ImmutableDictionary<'Key, 'Value>
Public Function CreateRange(Of TKey, TValue) (keyComparer As IEqualityComparer(Of TKey), items As IEnumerable(Of KeyValuePair(Of TKey, TValue))) As ImmutableDictionary(Of TKey, TValue)
Type Parameters
- TKey
The type of keys in the dictionary.
- TValue
The type of values in the dictionary.
Parameters
- keyComparer
- IEqualityComparer<TKey>
The comparer implementation to use to compare keys for equality.
- items
- IEnumerable<KeyValuePair<TKey,TValue>>
The items to add to the dictionary before it's immutable.
Returns
A new immutable dictionary that contains the specified items and uses the specified comparer.
Applies to
.NET 9 and other versions
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9 |
.NET Framework | 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided) |
.NET Standard | 2.0 (package-provided) |
UWP | 10.0 |
CreateRange<TKey,TValue>(IEqualityComparer<TKey>, IEqualityComparer<TValue>, IEnumerable<KeyValuePair<TKey,TValue>>)
- Source:
- ImmutableDictionary.cs
- Source:
- ImmutableDictionary.cs
- Source:
- ImmutableDictionary.cs
- Source:
- ImmutableDictionary.cs
Creates a new immutable dictionary that contains the specified items and uses the specified key comparer.
public:
generic <typename TKey, typename TValue>
static System::Collections::Immutable::ImmutableDictionary<TKey, TValue> ^ CreateRange(System::Collections::Generic::IEqualityComparer<TKey> ^ keyComparer, System::Collections::Generic::IEqualityComparer<TValue> ^ valueComparer, System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<TKey, TValue>> ^ items);
public static System.Collections.Immutable.ImmutableDictionary<TKey,TValue> CreateRange<TKey,TValue>(System.Collections.Generic.IEqualityComparer<TKey> keyComparer, System.Collections.Generic.IEqualityComparer<TValue> valueComparer, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>> items);
public static System.Collections.Immutable.ImmutableDictionary<TKey,TValue> CreateRange<TKey,TValue>(System.Collections.Generic.IEqualityComparer<TKey>? keyComparer, System.Collections.Generic.IEqualityComparer<TValue>? valueComparer, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>> items);
static member CreateRange : System.Collections.Generic.IEqualityComparer<'Key> * System.Collections.Generic.IEqualityComparer<'Value> * seq<System.Collections.Generic.KeyValuePair<'Key, 'Value>> -> System.Collections.Immutable.ImmutableDictionary<'Key, 'Value>
Public Function CreateRange(Of TKey, TValue) (keyComparer As IEqualityComparer(Of TKey), valueComparer As IEqualityComparer(Of TValue), items As IEnumerable(Of KeyValuePair(Of TKey, TValue))) As ImmutableDictionary(Of TKey, TValue)
Type Parameters
- TKey
The type of keys in the dictionary.
- TValue
The type of values in the dictionary.
Parameters
- keyComparer
- IEqualityComparer<TKey>
The comparer implementation to use to compare keys for equality.
- valueComparer
- IEqualityComparer<TValue>
The comparer implementation to use to compare values for equality.
- items
- IEnumerable<KeyValuePair<TKey,TValue>>
The items to add to the dictionary before it's immutable.
Returns
A new immutable dictionary that contains the specified items and uses the specified comparer.
Applies to
.NET 9 and other versions
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9 |
.NET Framework | 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided) |
.NET Standard | 2.0 (package-provided) |
UWP | 10.0 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: