In the below sample code, I have tried to use Nullable(of T) for DateTime and I want to use it same of the Dimensions property which is List(of Dimension).
Private _duedate As Nullable(Of DateTime)
Public Property DueDate() As Nullable(Of DateTime)
Get
Return _duedate
End Get
Set(ByVal value As Nullable(Of DateTime))
_duedate = value
End Set
End Property
Private _dimensions As List(Of Dimension)
Public Property Dimensions() As List(Of Dimension)
Get
Return _dimensions
End Get
Set(ByVal value As List(Of Dimension))
_dimensions = value
End Set
End Property
If we can then please any help on how can we do it would be appreciated.
Thanks.
There is no need to use
Nullable(Of T)forList(Of T). Simply useList(Of T)directly and useNothingfor the no value state.The basic capability
Nullable(Of T)provides is for value types to have a no-value state. This concept is clearer in C# where there is a syntactic difference between no valuenulland default valuedefault(T). In VB.Net though there is simplyNothingwhich represents both no value for reference types and default value for value types.