public Orders AddOrders([FromBody] OrderInput Input) { var modelInput = new Orders { UserId = Input.UserId, ProductId = Input.ProductId }; var result = _ordersService.AddOrders(modelInput); return(result); }
public ActionResult Post([FromBody] OrdersRequestModel ordersRequest) { IPAddress remoteIpAddress = Request.HttpContext.Connection.RemoteIpAddress; (bool isValid, int OrderID)ordersResponse = _orderService.AddOrders(ordersRequest, remoteIpAddress.ToString()); if (ordersResponse.isValid) { return(Ok($"{BaseURL}/{ordersResponse.OrderID}")); } else { return(BadRequest()); } }