I have a nullable public property on a class using Vb.net 3.5:
Public Property TicketCharge() As Nullable(Of Decimal)
Get
If _TicketCharge = Nothing Then
Return Nothing
Else
Return _TicketCharge
End If
End Get
Set(ByVal value As Nullable(Of Decimal))
If value.HasValue Then _TicketCharge = value
End Set
End Property
There's a method that assigns the value. It works fine, except for when I try to assign the value 0 (zero) to it.
If FundBuySell = "Exchange $" Or FundBuySell = "Exchange Shares" Then
TicketCharge = 0
Else
When I assign zero and then retrieve it, it shows the property = nothing.
I need the property to be Null sometimes and Zero sometimes. Can someone explain what is going on?