Class KeyValuePairExtensions
- Namespace
- OverKizApi
- Assembly
- OverKizApi.dll
Provides KeyValuePair<TKey,TValue>.Deconstruct for targets below .NET 5
where the BCL does not include it, allowing foreach (var (key, value) in dict) syntax.
public static class KeyValuePairExtensions
- Inheritance
-
KeyValuePairExtensions
- Inherited Members
Methods
Deconstruct<TKey, TValue>(KeyValuePair<TKey, TValue>, out TKey, out TValue)
Deconstructs a KeyValuePair<TKey, TValue> into its key and value components,
enabling foreach (var (key, value) in dictionary) syntax on targets below .NET 5
where the BCL does not provide this method natively.
public static void Deconstruct<TKey, TValue>(this KeyValuePair<TKey, TValue> pair, out TKey key, out TValue value)
Parameters
pairKeyValuePair<TKey, TValue>The key/value pair to deconstruct.
keyTKeyReceives the Key.
valueTValueReceives the Value.
Type Parameters
TKeyThe type of the key.
TValueThe type of the value.