public ActionResult <int> AddOrder(OrderCreationRequestModel model) { OrderDto orderDto = _mapper.Map <OrderCreationRequestModel, OrderDto>(model); orderDto = _orderService.AddProductToLine(orderDto); return(Ok(orderDto.Id)); }
public async Task Create(OrderCreationRequestModel requestModel) { HttpClient httpClient = this.CreateHttpClient(); StringContent content = new StringContent(JsonConvert.SerializeObject(requestModel), Encoding.UTF8, "application/json"); HttpResponseMessage response = await httpClient.PostAsync("/api/order", content); response.EnsureSuccessStatusCode(); }