Esempio n. 1
0
        public async Task <IActionResult> Add([FromBody] OrderViewModel OrderViewModel)
        {
            var data = await _orderAppService.AddOrder(OrderViewModel);

            if (data.ValidationResult.IsValid)
            {
                return(Ok(data));
            }
            return(BadRequest(data));
        }
Esempio n. 2
0
        public IActionResult Post([FromBody] CreateOrderCommand createOrderCommand)
        {
            var commandResult = _orderAppService.AddOrder(createOrderCommand);

            if (commandResult.Success)
            {
                return(Ok(commandResult));
            }

            return(BadRequest(commandResult));
        }