Clean up, add DataRow Extension
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
Imports DigitalData.Modules.Language
|
||||
|
||||
Public Class Helpers
|
||||
Public Shared Function GetRowItem(Of T)(pRow As DataRow, pFieldName As String, Optional pDefaultValue As T = Nothing) As T
|
||||
Try
|
||||
Return Utils.NotNull(pRow.Item(pFieldName), pDefaultValue)
|
||||
Catch ex As Exception
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Function TryGetDictionaryItem(Of T)(pDictionary As IDictionary(Of String, T), pKey As String) As T
|
||||
If pDictionary.ContainsKey(pKey) Then
|
||||
Return pDictionary.Item(pKey)
|
||||
Else
|
||||
Return Nothing
|
||||
End If
|
||||
End Function
|
||||
End Class
|
||||
Reference in New Issue
Block a user