Exemplo n.º 1
0
        public async Task <HttpResponseMessage> AddItemToOrder(Guid orderId, Item item)
        {
            var request = new AddItemToOrderRequest
            {
                Uri         = new Uri(BaseUri + orderId + "/items"),
                HttpContent = HttpHelperService.CreateHttpContent(item)
            };

            return(await HttpRequestService.PostAsync(request));
        }
Exemplo n.º 2
0
        public async Task <HttpResponseMessage> UpdateItemQuantity(int quantity, Guid orderId, Guid itemId)
        {
            var request = new UpdateItemQuantityRequest
            {
                Uri         = new Uri(BaseUri + orderId + "/items/" + itemId + "/quantity"),
                HttpContent = HttpHelperService.CreateHttpContent(quantity)
            };

            return(await HttpRequestService.PatchAsync(request));
        }
Exemplo n.º 3
0
        public async Task <HttpResponseMessage> CreateOrder(Order order)
        {
            var request = new CreateOrderRequest
            {
                Uri         = new Uri(BaseUri),
                HttpMethod  = HttpMethod.Post,
                HttpContent = HttpHelperService.CreateHttpContent(order)
            };

            return(await HttpRequestService.PostAsync(request));
        }