I have the following business logic:
public decimal Price
{
get {
if (OrderSize == Size.Small)
{
_price = decimal.Multiply(_price, (decimal)0.8);
}
else if (OrderSize == Size.Large)
{
_price = decimal.Multiply(_price, (decimal)1.2);
}
return _price;
}
set {
_price = value;
}
}
The price should be only changed once based on the chosen OrderSize. When this order is retrieved it calculates the price again which is obviously not what i want. What is the best way to make this only execute once?