Skip to content

Instantly share code, notes, and snippets.

@inhji
Created January 27, 2016 09:57
Show Gist options
  • Save inhji/c73521faa94449d2071f to your computer and use it in GitHub Desktop.
Save inhji/c73521faa94449d2071f to your computer and use it in GitHub Desktop.
NotNull
Public Function NotNull(Of T)(ByVal value As T, Optional ByVal defaultValue As T) As T
If value Is Nothing OrElse String.IsNullOrEmpty(value.ToString) OrElse IsDBNull(value) Then
Return defaultValue
Else
Return value
End If
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment