/// <summary> /// updates a productOrder in th database /// </summary> /// <param name="productOrder">product order to update</param> public void AddProductOrder(Business.ProductOrder productOrder) { Entities.ProductOrder entity = new Entities.ProductOrder() { Id = 0, OrderId = productOrder.OrderId, ProductId = productOrder.ProductId, Quantity = productOrder.Quantity, }; _context.Add(entity); }
/// <summary> /// converts a prodution order entity into a production order object /// </summary> /// <param name="product">production order entity to be converted</param> /// <returns>production order object</returns> public static Business.ProductOrder MapProductOrder(Entities.ProductOrder product) { return(new Business.ProductOrder { Name = product.Product.Name, Id = product.Id, OrderId = product.OrderId, ProductId = product.ProductId, Quantity = product.Quantity, PricePerUnit = product.Product.CostPerUnit, }); }