Class XDictionary
Extension methods for Dictionary.
Inheritance
System.Object
XDictionary
Namespace: Galaxon.Core.Collections
Assembly: Galaxon.Core.dll
Syntax
public static class XDictionary : object
Methods
Flip<TKey, TValue>(Dictionary<TKey, TValue>)
Create a new dictionary from the instance with keys and values flipped.
Declaration
public static Dictionary<TValue, TKey> Flip<TKey, TValue>(this Dictionary<TKey, TValue> dict)
Parameters
| Type | Name | Description |
|---|---|---|
| Dictionary<TKey, TValue> | dict | The instance. |
Returns
| Type | Description |
|---|---|
| Dictionary<TValue, TKey> | The flipped dictionary. |
Type Parameters
| Name | Description |
|---|---|
| TKey | The key type. |
| TValue | The value type. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentInvalidException | If the instance contains duplicate values. |