Validation and stuff
This commit is contained in:
@@ -4,6 +4,11 @@ Module IDictionaryEx
|
||||
<Extension()>
|
||||
Function GetOrDefault(Of TKey, TValue)(pDictionary As Dictionary(Of TKey, TValue), pKey As TKey, Optional pOnMissing As TValue = Nothing) As TValue
|
||||
Dim oValue As TValue
|
||||
|
||||
If pKey Is Nothing Then
|
||||
Return Nothing
|
||||
End If
|
||||
|
||||
Return IIf(pDictionary.TryGetValue(pKey, oValue), oValue, pOnMissing)
|
||||
End Function
|
||||
|
||||
|
||||
Reference in New Issue
Block a user