Is it correct to correct properties values on the fly?
for example: (note the .ToLower)
Public Property X() As String
Get
Return _x.ToLower
End Get
Set(ByVal Value As String)
_x = value.ToLower
End Set
End Property
Is it correct to correct properties values on the fly?
for example: (note the .ToLower)
Public Property X() As String
Get
Return _x.ToLower
End Get
Set(ByVal Value As String)
_x = value.ToLower
End Set
End Property
There is nothing incorrect about standardizing your properties in getter/setters. Without any context of what X represents it is hard determine if a property is the right way to access and update the value of X. Depending on the application, it might make sense to not have a public setter at all but instead have a method such as CustomerRequestedXToChange(XUpdatedValue as String)
Some improvements to your code though: