Created
May 16, 2013 06:57
-
-
Save eithe/5589891 to your computer and use it in GitHub Desktop.
SQL-like IsNull (VB.net)
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 Class Util | |
Public Shared Function IsNull(Of T)(ByVal Value As T, ByVal DefaultValue As T) As T | |
If Value Is Nothing OrElse IsDBNull(Value) Then | |
Return DefaultValue | |
Else | |
Return Value | |
End If | |
End Function | |
End Class |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment