Validation and stuff

This commit is contained in:
Jonathan Jenne
2021-11-16 16:16:46 +01:00
parent 964f2ee60c
commit 47c22e9361
13 changed files with 140 additions and 70 deletions

View File

@@ -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