public void Create(OrderInfo orderInfo) { if (orderInfo == null) { throw new ArgumentNullException("订单信息有误"); } _orderInfoRepository.Add(orderInfo); _orderInfoRepository.UnitOfWork.Commit(); }
public IActionResult Add([FromBody] OrderInfo model) { try { model.Status = (int)OrderStatusEnum.已下单; model.CreateTime = DateTime.Now; model.OrderNo = ""; _orderInfoRepository.Add(model); _orderInfoRepository.Commit(); return(Ok()); } catch (Exception ex) { Response.StatusCode = 500; return(null); } }