Example #1
0
 internal Line(SalesOrderId salesOrder, ProductId product, Quantity quantity, UnitPrice price, SalesTax tax)
 {
     Id         = new LineId(Guid.NewGuid());
     SalesOrder = salesOrder;
     Quantity   = quantity;
     Product    = product;
     Price      = price;
     Tax        = tax;
 }
Example #2
0
        public Line Get(LineId lineId)
        {
            var line = _lines.FirstOrDefault(p => p.Id.Id == lineId.Id);

            if (line == null)
            {
                throw new LineDoesNotExist();
            }

            return(line);
        }
Example #3
0
 public void Remove(LineId lineId)
 {
     _lines.RemoveAll(p => p.Id.Id == lineId.Id);
 }