Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Extension method: void RemoveSafe<K, V>(this IDictionary<K, List<V>>, K, V)

Declaration

public static void RemoveSafe<K, V>(
    this IDictionary<K, List<V>> dic,
    K key,
    V value
)

Summary

Removes the first occurrence of an element from a List<V> stored in the current IDictionary<K, List<V>>. If this leaves the list stored at the specified key empty, the key is removed from the IDictionary. If the key is not in the dictionary to begin with, nothing happens.

Generic type parameters

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

Parameters

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