public async Task <IActionResult> CreateOrderAsync([FromBody] OrderSaveDto orderSaveDto) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var order = mapper.Map <OrderSaveDto, Order>(orderSaveDto); var response = await orderService.CreateOrderAsync(order); if (!response) { return(BadRequest()); } return(Ok(response)); }
public ResponseDto Save(OrderSaveDto saveDto) { ResponseDto responseDto = new ResponseDto(); OrderSaveBo saveBo = new OrderSaveBo() { BasketId = saveDto.BasketId, DeliveryAddressId = saveDto.DeliveryAddressId, Notes = saveDto.Notes, Session = Session }; ResponseBo responseBo = orderBusiness.Save(saveBo); responseDto = responseBo.ToResponseDto(); base.SendNotifyWsToList(responseBo.PersonNotifyList); return(responseDto); }