Created
January 27, 2016 09:57
-
-
Save inhji/c73521faa94449d2071f to your computer and use it in GitHub Desktop.
NotNull
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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