Ejemplo n.º 1
0
 public OrderClass CreateOrderFromOrderDTOCreate(OrderDTO_Create orderDTO)
 {
     return(new OrderClass
     {
         CustomerID = orderDTO.CustomerID,
         ItemGroups = _itemGroupMapper.CreateItemGroupFromItemGroupDTOList(orderDTO.ItemGroupDTO),
     });
 }
Ejemplo n.º 2
0
        public ActionResult <OrderDTO_Return> CreateOrder([FromBody] OrderDTO_Create orderedItems)
        {
            var result = _orderService.CreateOrder(_ordermapper.CreateOrderFromOrderDTOCreate(orderedItems));

            if (result == null)
            {
                return(BadRequest("No items to order"));
            }
            else
            {
                return(Ok(_ordermapper.CreateOrderDTOReturnFromOrder(result)));
            }
        }