public OrderLine CreateOrderDetail(Order order, Product product) { var line = new OrderLine { ProductID = product.ProductID, Quantity = 1, UnitPrice = product.UnitPrice.GetValueOrDefault(0) }; order.Lines.Add(line); return line; }
public OrderLine CreateOrderDetail(Order order, Product product, decimal price, short quantity, float discount) { var line = new OrderLine { ProductID = product.ProductID, Discount = discount, Quantity = quantity, UnitPrice = price }; order.Lines.Add(line); return line; }