public IActionResult Add(Order order) { var result = (_orderServices.Add(order)); if (result.Success) { return(Ok(result.Success)); } return(BadRequest(result.Message)); }
public async Task <IActionResult> Add([FromBody] OrderAddDTO addOrder) { try { var result = await _service.Add(addOrder); return(Ok(result)); } catch (Exception ex) { return(Ok(ResponseResult.Failure <OrderDTO>(ex.Message))); } }
public void Post([FromBody] OrderViewModel u) { orderService.Add(UserMapper.Map <OrderViewModel, OrderDTO>(u)); }
public async Task <MessageModel> Add(Order model) { model.Id = 0; return(new MessageModel(await _OrderServices.Add(model) > 0)); }
public void Post([FromBody] OrderViewModel u) { orderService.Add(u.User, u.OrderedItems, u.Address, u.Status); }
public ActionResult <bool> Put([FromBody] OrderViewModel model) { var result = _orderServices.Add(model); return(Ok(result)); }