Ejemplo n.º 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()))}");
 }
Ejemplo n.º 2
0
 private void ComputeTotalCost()
 {
     TotalCost = ShoppingItems.Select(item => item.Cost).Sum();
 }