public void AddProductsToCart(int quantity, Product product) { if(_products.ContainsKey(product)) { _products[product] += quantity; } else { _products.Add(product, quantity); } }
public bool Equals(Product other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return other.Id == Id && Equals(other.Name, Name); }