public async Task <IActionResult> Add([FromBody] OrderViewModel OrderViewModel) { var data = await _orderAppService.AddOrder(OrderViewModel); if (data.ValidationResult.IsValid) { return(Ok(data)); } return(BadRequest(data)); }
public IActionResult Post([FromBody] CreateOrderCommand createOrderCommand) { var commandResult = _orderAppService.AddOrder(createOrderCommand); if (commandResult.Success) { return(Ok(commandResult)); } return(BadRequest(commandResult)); }