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)); }
// 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);