示例#1
0
 public static Expenses AsFlat(string name, Amount amount)
 {
     return(new Expenses(name, amount, false));
 }
示例#2
0
 public static Expenses AsRate(string name, Amount amount)
 {
     return(new Expenses(name, amount, true));
 }
示例#3
0
 private Expenses(string name, Amount amount, bool isRate)
 {
     this.Name   = name;
     this.Amount = amount;
     this.IsRate = isRate;
 }
示例#4
0
 public Price CalculateFrom(Rate percentage)
 => new Price(Amount.CalculateFrom(percentage), Currency);
示例#5
0
 public Price ApplyDiscount(Discount discount)
 => new Price(Amount.ApplyDiscount(discount), Currency);
示例#6
0
 public Price ApplyTax(Tax tax)
 => new Price(Amount.ApplyTax(tax), Currency);