using System.Collections.Generic;
public Product(string name)
public override string ToString()
return this.cart.name + ". " + this.name;
public void Notify(Cart cart)
public List<Product> products;
this.products = new List<Product>();
public void Add(Product product)
this.products.Add(product);
public static void Main()
var cart = new Cart("Customer #1");
var milk = new Product("Milk");
var bread = new Product("Bread");
Console.WriteLine(bread);