Lets say you have a Class with 300 properties with no backing variables, each of those properties returns a decimal/double.
Example:
public decimal MathValue { get; set; }
Now you decided that each one of those values should be rounded.
I am looking for the simplest way to refactor this without having to rewrite all of those properties.
Something, of this equivalent that actually works :D:
public decimal MathValue { get {return Math.Round(MathValue);} set; }
You could create a new value type that pretends to be a decimal, but returns the rounded value. Something like this:
Each property in your class should be of type
RoundedDecimalinstead ofdecimal.