Beispiel #1
0
 public Entity.Orderitem ParseOrderItem(Model.OrderItem orderitem)
 {
     return(new Entity.Orderitem
     {
         OrderItemsId = orderitem.OrderItemsID,
         OrderItemQuantity = orderitem.OrderItemsQuantity,
         OrderId = orderitem.OrderID,
         ProductId = orderitem.productID
     });
 }
Beispiel #2
0
        public List <OrderItem> GetOrderItems(int orderID)
        {
            List <Entity.Orderitem> orderitemsE = _context.Orderitems.Where(x => x.OrderId == orderID).ToList();
            List <Model.OrderItem>  orderitemsM = new List <Model.OrderItem>();

            foreach (Entity.Orderitem o in orderitemsE)
            {
                Model.OrderItem addedItem = _mapper.ParseOrderItem(o);
                orderitemsM.Add(addedItem);
            }
            return(orderitemsM);
        }