DictionaryExtensions.

Increment<TKey>(IDictionary<TKey, int>, TKey) Method

Summary

Increments integer value in a dictionary by 1.

Syntax

public static int Increment<TKey>(this IDictionary<TKey, int> dicionary, TKey key)

Type Parameters

Name Description
TKey The type of keys in the dictionary.

Parameters

Name Type Description
dicionary IDictionary<TKey, int> The dictionary to get element from.
key TKey The key of the element to increment and get.

Return Value

Type Description
int The element incremented by 1 with the specified key.