Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Extension method: bool AddSafe<K, V>(this IDictionary<K, HashSet<V>>, K, V)

Declaration

public static bool AddSafe<K, V>(
    this IDictionary<K, HashSet<V>> dic,
    K key,
    V value
)

Summary

Adds an element to a HashSet<V> stored in the current IDictionary<K, HashSet<V>>. If the specified key does not exist in the current IDictionary, a new HashSet is created.

Generic type parameters

K Type of the key of the IDictionary.
V Type of the values in the HashSets.

Parameters

this IDictionary<K, HashSet<V>>dic IDictionary to operate on.
Kkey Key at which the HashSet is located in the IDictionary.
Vvalue Value to add to the HashSet located at the specified Key.