Nullable(Of T)的空值是多少?

tho*_*asb 1 vb.net nullable

我有一个可以为null的属性,我想返回一个空值.我怎么在VB.NET中这样做?

目前我使用这个解决方案,但我认为可能有更好的方法.

    Public Shared ReadOnly Property rubrique_id() As Nullable(Of Integer)
        Get
            If Current.Request.QueryString("rid") <> "" Then
                Return CInt(Current.Request.QueryString("rid"))
            Else
                Return (New Nullable(Of Integer)).Value
            End If
        End Get
    End Property
Run Code Online (Sandbox Code Playgroud)

Jon*_*Jon 6

您在寻找关键字"Nothing"吗?