Пример #1
0
        // Módosítás

        public async Task <OrderDto> AddOrderitemToOrder(string orderId, int orderItemId)
        {
            await orderRepository.AddItemToOrder(orderId, orderItemId);

            var result = await orderItemRepository.SetOrder(orderItemId, orderId);

            return(mapper.Map <OrderDto>(result));
        }
Пример #2
0
        public void AddItemToOrderTest()
        {
            var allOrders = _orderRepository.GetAll();
            var order     = allOrders.Result.FirstOrDefault();

            var allProducts = _productRepository.GetAll().Result;
            var babyPampas  = allProducts.FirstOrDefault(f => f.Name.Equals("Baby Pampas"));

            var result = _orderRepository.AddItemToOrder(order, babyPampas);

            Assert.IsTrue(result.Result);
        }