public void RemoveLineItem(PurchaseOrderLine line) { if (!_lineItems.Contains(line)) { throw new PurchaseOrderTrackerException($"Line item is not part of this purchase order: {line}"); } _lineItems.Remove(line); }
public void AddLineItem(PurchaseOrderLine line) { if (!ProductIsFromSameSupplier(line.Product)) { throw new PurchaseOrderTrackerException( $"Line item product must be from the same supplier: {line.Product}"); } _lineItems.Add(line); }