【发布时间】:2015-01-21 15:34:59
【问题描述】:
如何在 Visual Basic 中定义 Nullable 类型属性。 如何利用 Setter 中的 HasValue 属性?
谢谢。
【问题讨论】:
-
Public Property Bar As Nullable(Of Integer)或Public Property Foo As Integer? -
Google
How do you define a Nullable Type Property in Visual Basic并点击第一个结果:Nullable Value Types (Visual Basic)。 -
@plutonix 为整数?
-
是的 - 问号是 Nullable 的简写。使用 Nullables 时,您会在 Intellisense 中看到它...
Dim foo as Int32?