ImmutableDictionary.Create 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| Create<TKey,TValue>() |
建立一個空的不可變字典。 |
| Create<TKey,TValue>(IEqualityComparer<TKey>) |
建立一個空的不可變字典,使用指定的金鑰比較器。 |
| Create<TKey,TValue>(IEqualityComparer<TKey>, IEqualityComparer<TValue>) |
建立一個空的不可變字典,使用指定的鍵值比較器。 |
Create<TKey,TValue>()
建立一個空的不可變字典。
public:
generic <typename TKey, typename TValue>
static System::Collections::Immutable::ImmutableDictionary<TKey, TValue> ^ Create();
public static System.Collections.Immutable.ImmutableDictionary<TKey,TValue> Create<TKey,TValue>();
static member Create : unit -> System.Collections.Immutable.ImmutableDictionary<'Key, 'Value>
Public Function Create(Of TKey, TValue) () As ImmutableDictionary(Of TKey, TValue)
類型參數
- TKey
字典中儲存的鍵型。
- TValue
字典儲存的值類型。
傳回
一本空洞、不可改變的字典。
適用於
Create<TKey,TValue>(IEqualityComparer<TKey>)
建立一個空的不可變字典,使用指定的金鑰比較器。
public:
generic <typename TKey, typename TValue>
static System::Collections::Immutable::ImmutableDictionary<TKey, TValue> ^ Create(System::Collections::Generic::IEqualityComparer<TKey> ^ keyComparer);
public static System.Collections.Immutable.ImmutableDictionary<TKey,TValue> Create<TKey,TValue>(System.Collections.Generic.IEqualityComparer<TKey> keyComparer);
public static System.Collections.Immutable.ImmutableDictionary<TKey,TValue> Create<TKey,TValue>(System.Collections.Generic.IEqualityComparer<TKey>? keyComparer);
static member Create : System.Collections.Generic.IEqualityComparer<'Key> -> System.Collections.Immutable.ImmutableDictionary<'Key, 'Value>
Public Function Create(Of TKey, TValue) (keyComparer As IEqualityComparer(Of TKey)) As ImmutableDictionary(Of TKey, TValue)
類型參數
- TKey
字典中儲存的鍵型。
- TValue
字典儲存的值類型。
參數
- keyComparer
- IEqualityComparer<TKey>
用於判斷字典中鍵值相等的實作。
傳回
一本空洞、不可改變的字典。
適用於
Create<TKey,TValue>(IEqualityComparer<TKey>, IEqualityComparer<TValue>)
建立一個空的不可變字典,使用指定的鍵值比較器。
public:
generic <typename TKey, typename TValue>
static System::Collections::Immutable::ImmutableDictionary<TKey, TValue> ^ Create(System::Collections::Generic::IEqualityComparer<TKey> ^ keyComparer, System::Collections::Generic::IEqualityComparer<TValue> ^ valueComparer);
public static System.Collections.Immutable.ImmutableDictionary<TKey,TValue> Create<TKey,TValue>(System.Collections.Generic.IEqualityComparer<TKey> keyComparer, System.Collections.Generic.IEqualityComparer<TValue> valueComparer);
public static System.Collections.Immutable.ImmutableDictionary<TKey,TValue> Create<TKey,TValue>(System.Collections.Generic.IEqualityComparer<TKey>? keyComparer, System.Collections.Generic.IEqualityComparer<TValue>? valueComparer);
static member Create : System.Collections.Generic.IEqualityComparer<'Key> * System.Collections.Generic.IEqualityComparer<'Value> -> System.Collections.Immutable.ImmutableDictionary<'Key, 'Value>
Public Function Create(Of TKey, TValue) (keyComparer As IEqualityComparer(Of TKey), valueComparer As IEqualityComparer(Of TValue)) As ImmutableDictionary(Of TKey, TValue)
類型參數
- TKey
字典中儲存的鍵型。
- TValue
字典儲存的值類型。
參數
- keyComparer
- IEqualityComparer<TKey>
用於判斷字典中鍵值相等的實作。
- valueComparer
- IEqualityComparer<TValue>
用於判定字典中數值相等的實作。
傳回
一本空洞、不可改變的字典。