@@ -13,9 +13,17 @@ public static class DictionaryExtensions
13
13
{
14
14
#region GetValueOrDefault
15
15
/// <summary>
16
- /// Returns value associated with <paramref name="key"/>, or default(TValue) if key does not exists in
17
- /// <paramref name="dictionary"/>
16
+ /// Returns value associated with <paramref name="key" />, or default(TValue) if key does not exists in
17
+ /// <paramref name="dictionary" />
18
18
/// </summary>
19
+ /// <typeparam name="TKey">The type of the key.</typeparam>
20
+ /// <typeparam name="TValue">The type of the value.</typeparam>
21
+ /// <param name="dictionary">The dictionary.</param>
22
+ /// <param name="key">The key.</param>
23
+ /// <returns>
24
+ /// Value, associated with the <paramref name="key"/>, or default value if <paramref name="key"/> does not exists
25
+ /// in <paramref name="dictionary"/>
26
+ /// </returns>
19
27
[ Pure ]
20
28
public static TValue GetValueOrDefault < TKey , TValue > ( [ NotNull ] this IDictionary < TKey , TValue > dictionary , TKey key )
21
29
{
@@ -32,6 +40,14 @@ public static TValue GetValueOrDefault<TKey, TValue>([NotNull] this IDictionary<
32
40
/// Returns value associated with <paramref name="key"/>, or default(TValue) if key does not exists in
33
41
/// <paramref name="dictionary"/>
34
42
/// </summary>
43
+ /// <typeparam name="TKey">The type of the key.</typeparam>
44
+ /// <typeparam name="TValue">The type of the value.</typeparam>
45
+ /// <param name="dictionary">The dictionary.</param>
46
+ /// <param name="key">The key.</param>
47
+ /// <returns>
48
+ /// Value, associated with the <paramref name="key"/>, or default value if <paramref name="key"/> does not exists
49
+ /// in <paramref name="dictionary"/>
50
+ /// </returns>
35
51
// Resolve ambiguity between IDictionary and IReadOnlyDictionary in System.Dictionary class.
36
52
[ Pure ]
37
53
public static TValue GetValueOrDefault < TKey , TValue > ( [ NotNull ] this Dictionary < TKey , TValue > dictionary , TKey key ) =>
@@ -41,6 +57,14 @@ public static TValue GetValueOrDefault<TKey, TValue>([NotNull] this Dictionary<T
41
57
/// Returns value associated with <paramref name="key"/>, or default(TValue) if key does not exists in
42
58
/// <paramref name="dictionary"/>
43
59
/// </summary>
60
+ /// <typeparam name="TKey">The type of the key.</typeparam>
61
+ /// <typeparam name="TValue">The type of the value.</typeparam>
62
+ /// <param name="dictionary">The dictionary.</param>
63
+ /// <param name="key">The key.</param>
64
+ /// <returns>
65
+ /// Value, associated with the <paramref name="key"/>, or default value if <paramref name="key"/> does not exists
66
+ /// in <paramref name="dictionary"/>
67
+ /// </returns>
44
68
[ Pure ]
45
69
public static TValue GetValueOrDefault < TKey , TValue > (
46
70
[ NotNull ] this IReadOnlyDictionary < TKey , TValue > dictionary ,
@@ -59,6 +83,15 @@ public static TValue GetValueOrDefault<TKey, TValue>(
59
83
/// Returns value associated with <paramref name="key"/>, or <paramref name="defaultValue"/> if key does not exists
60
84
/// in <paramref name="dictionary"/>
61
85
/// </summary>
86
+ /// <typeparam name="TKey">The type of the key.</typeparam>
87
+ /// <typeparam name="TValue">The type of the value.</typeparam>
88
+ /// <param name="dictionary">The dictionary.</param>
89
+ /// <param name="key">The key.</param>
90
+ /// <param name="defaultValue">Default value.</param>
91
+ /// <returns>
92
+ /// Value, associated with the <paramref name="key"/>, or <paramref name="defaultValue"/> if <paramref name="key"/>
93
+ /// does not exists in <paramref name="dictionary"/>
94
+ /// </returns>
62
95
[ Pure ]
63
96
public static TValue GetValueOrDefault < TKey , TValue > (
64
97
[ NotNull ] this IDictionary < TKey , TValue > dictionary ,
@@ -78,6 +111,15 @@ public static TValue GetValueOrDefault<TKey, TValue>(
78
111
/// Returns value associated with <paramref name="key"/>, or value returned by <paramref name="defaultValueFactory"/>
79
112
/// if key does not exists in <paramref name="dictionary"/>
80
113
/// </summary>
114
+ /// <typeparam name="TKey">The type of the key.</typeparam>
115
+ /// <typeparam name="TValue">The type of the value.</typeparam>
116
+ /// <param name="dictionary">The dictionary.</param>
117
+ /// <param name="key">The key.</param>
118
+ /// <param name="defaultValueFactory">Function to return default value.</param>
119
+ /// <returns>
120
+ /// Value, associated with the <paramref name="key"/>, or value returned by <paramref name="defaultValueFactory"/>
121
+ /// if <paramref name="key"/> does not exists in <paramref name="dictionary"/>
122
+ /// </returns>
81
123
[ Pure ]
82
124
public static TValue GetValueOrDefault < TKey , TValue > (
83
125
[ NotNull ] this IDictionary < TKey , TValue > dictionary ,
@@ -99,7 +141,7 @@ public static TValue GetValueOrDefault<TKey, TValue>(
99
141
/// <summary>
100
142
/// Adds a key/value pair to the <see cref="IDictionary{TKey,TValue}"/> if the key does not already exist.
101
143
/// </summary>
102
- /// <param name="dictionary"></param>
144
+ /// <param name="dictionary">The dictionary. </param>
103
145
/// <param name="key">The key of the element to add.</param>
104
146
/// <returns>
105
147
/// The value for the key. This will be either the existing value for the key if the key is already in the
@@ -122,7 +164,7 @@ public static TValue GetOrAdd<TKey, TValue>([NotNull] this IDictionary<TKey, TVa
122
164
/// <summary>
123
165
/// Adds a key/value pair to the <see cref="IDictionary{TKey,TValue}"/> if the key does not already exist.
124
166
/// </summary>
125
- /// <param name="dictionary"></param>
167
+ /// <param name="dictionary">The dictionary. </param>
126
168
/// <param name="key">The key of the element to add.</param>
127
169
/// <param name="value">the value to be added, if the key does not already exist</param>
128
170
/// <returns>
@@ -148,7 +190,7 @@ public static TValue GetOrAdd<TKey, TValue>(
148
190
/// <summary>
149
191
/// Adds a key/value pair to the <see cref="IDictionary{TKey,TValue}"/> if the key does not already exist.
150
192
/// </summary>
151
- /// <param name="dictionary"></param>
193
+ /// <param name="dictionary">The dictionary. </param>
152
194
/// <param name="key">The key of the element to add.</param>
153
195
/// <param name="valueFactory">The function used to generate a value for the key</param>
154
196
/// <returns>
@@ -177,7 +219,7 @@ public static TValue GetOrAdd<TKey, TValue>(
177
219
/// or updates a key/value pair <see cref="IDictionary{TKey,TValue}"/> by using the specified function
178
220
/// if the key already exists.
179
221
/// </summary>
180
- /// <param name="dictionary"></param>
222
+ /// <param name="dictionary">The dictionary. </param>
181
223
/// <param name="key">The key to be added or whose value should be updated</param>
182
224
/// <param name="addValue">The value to be added for an absent key</param>
183
225
/// <param name="updateValueFactory">The function used to generate a new value for an existing key based on the key's existing value</param>
@@ -210,7 +252,7 @@ public static TValue AddOrUpdate<TKey, TValue>(
210
252
/// or updates a key/value pair <see cref="IDictionary{TKey,TValue}"/> by using the specified function
211
253
/// if the key already exists.
212
254
/// </summary>
213
- /// <param name="dictionary"></param>
255
+ /// <param name="dictionary">The dictionary. </param>
214
256
/// <param name="key">The key to be added or whose value should be updated</param>
215
257
/// <param name="addValueFactory">The function used to generate a value for an absent key</param>
216
258
/// <param name="updateValueFactory">The function used to generate a new value for an existing key based on the key's existing value</param>
0 commit comments