Exemple #1
0
 public override string ToString()
 {
     return($"Id = {Id} TransactionTime = {TransactionTime}{Environment.NewLine}" +
            $"TotalPrice = {TotalPrice}{Environment.NewLine}" +
            $"{string.Join<string>(Environment.NewLine, ShoppingItems.Select(s => s.ToString()))}");
 }
Exemple #2
0
 private void ComputeTotalCost()
 {
     TotalCost = ShoppingItems.Select(item => item.Cost).Sum();
 }