Created
May 7, 2019 15:51
-
-
Save kasunkv/d2fa1c85437b3ca3a604d507f23f0c1e to your computer and use it in GitHub Desktop.
ProcessDiscount() method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public (double, List<string>) ProcessDiscount(OrderViewModel order) | |
{ | |
var discountDiscroptoons = new List<string>(); | |
var totalDiscount = 0.0; | |
foreach (var discount in _discounts) | |
{ | |
var addedDiscount = discount.CalculateDiscount(order); | |
if (addedDiscount > 0) | |
{ | |
discountDiscroptoons.Add(discount.Description); | |
} | |
totalDiscount += addedDiscount; | |
} | |
return (totalDiscount, discountDiscroptoons); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment