Developer technologies | VB
An object-oriented programming language developed by Microsoft that can be used in .NET.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hallo,
I have class object and it has some Nullable properties like ( Public property C1 as integer?, C2 as integer? ....etc) and i have a read only property like below but it does not sum when any of the property is null. What is the correct way to Sum? Thanks
Public read only property Total as integer?
Get
Return C1 + C2 + C3
End get
End property
Try one of solutions:
Return C1.GetValueOrDefault + C2.GetValueOrDefault + C3.GetValueOrDefault