public decimal GetPrice() { decimal?rentalPrice = Rentals.GetTotalPrice(); if (rentalPrice.HasValue) { decimal?priceAfterDiscount = Discount?.ApplyDiscount(Rentals); return(priceAfterDiscount.HasValue ? priceAfterDiscount.Value : rentalPrice.Value); } else { return(0); } }
public void ApplyDiscount() { var products = (new Product()).GetProducts(); Discount.ApplyDiscount(products); }