Skip to content

Commit

Permalink
Update CollectionValueGetter.vb
Browse files Browse the repository at this point in the history
  • Loading branch information
xieguigang committed Aug 22, 2023
1 parent 9c810bf commit 19fb653
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -330,16 +330,16 @@ Public Module CollectionValueGetter
End Function

<Extension>
Public Function TryGetValue(Of TKey, TValue, TProp)(hash As Dictionary(Of TKey, TValue), Index As TKey, prop As String) As TProp
If hash Is Nothing Then
Public Function TryGetValue(Of TKey, TValue, TProp)(dict As Dictionary(Of TKey, TValue), Index As TKey, prop As String) As TProp
If dict Is Nothing Then
Return Nothing
End If

If Not hash.ContainsKey(Index) Then
If Not dict.ContainsKey(Index) Then
Return Nothing
End If

Dim obj As TValue = hash(Index)
Dim obj As TValue = dict(Index)
Dim propertyInfo As PropertyInfo = obj.GetType.GetProperty(prop)

If propertyInfo Is Nothing Then
Expand Down

0 comments on commit 19fb653

Please sign in to comment.