Ejemplo n.º 1
0
        public static List <ProductInOrderTable> ConvertToProductInOrderTable(List <ProductInOrder> productInOrders, int idOrder)
        {
            List <ProductInOrderTable> productInOrderTables = new List <ProductInOrderTable>();

            for (int i = 0; i < productInOrders.Count; i++)
            {
                ProductInOrderTable productInOrderTable = new ProductInOrderTable();
                productInOrderTable.Id        = -1;
                productInOrderTable.Name      = productInOrders[i].Name;
                productInOrderTable.OrderId   = idOrder;
                productInOrderTable.ProductId = productInOrders[i].ProductId;
                productInOrderTable.Quantity  = productInOrders[i].Quantity;
                productInOrderTables.Add(productInOrderTable);
            }

            return(productInOrderTables);
        }
Ejemplo n.º 2
0
 public void SaveProductInOrderTable(ProductInOrderTable productInOrder)
 {
     _healthStore.ProductInOrderTables.Add(productInOrder);
     _healthStore.SaveChanges();
 }