Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Extension method: void AddSafe<K1, K2, V>(this IDictionary<K1, Dictionary<K2, List<V>>>, K1, K2, V)

Declaration

public static void AddSafe<K1, K2, V>(
    this IDictionary<K1, Dictionary<K2, List<V>>> dic,
    K1 key1,
    K2 key2,
    V value
)

Summary

Adds an element to a List<V> stored in a two-level Dictionary<,>. If the specified key does not exist in the current Dictionary, a new List is created.

Generic type parameters

K1 Type of the key of the first-level Dictionary.
K2 Type of the key of the second-level Dictionary.
V Type of the values in the Lists.

Parameters

this IDictionary<K1, Dictionary<K2, List<V>>>dic Dictionary to operate on.
K1key1 Key at which the second-level Dictionary is located in the first-level Dictionary.
K2key2 Key at which the list is located in the second-level Dictionary.
Vvalue Value to add to the List located at the specified Keys.