예제 #1
0
        public ProductCalculated CalculatePriceOptionalReturn(int quantity, SendOverseas sendOverseas = SendOverseas.Yes, AddVat addVat = AddVat.Yes)
        {
            var price = 10 * quantity * (sendOverseas == SendOverseas.Yes ? 1.04 : 1) * (addVat == AddVat.Yes ? 1.175 : 1);

            return(new ProductCalculated(price: price, daysToDeliver: 5));
        }
예제 #2
0
 // using optional Enums
 public double CalculatePriceOptional(int quantity, SendOverseas sendOverseas = SendOverseas.Yes, AddVat addVat = AddVat.Yes)
 => 10 * quantity * (sendOverseas == SendOverseas.Yes ? 1.04 : 1) * (addVat == AddVat.Yes ? 1.175 : 1);