Ejemplo n.º 1
0
        public IActionResult AddOrder([FromBody] OrderViewModel model)
        {
            var res = _orderOperations.AddOrder(model);

            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            return(Created("", res));
        }
Ejemplo n.º 2
0
        public async Task <Response> AddOrder([FromBody] OrderViewModel order)
        {
            var userId = TokenManager.GetUserId(User);

            await _orderOperations.AddOrder(order, userId);

            return(new Response
            {
                Status = ResponseStatus.Ok,
            });
        }
Ejemplo n.º 3
0
 public IActionResult Add([FromBody] OrderRegisterModel model)
 {
     if (ModelState.IsValid)
     {
         _orderOperations.AddOrder(model);
     }
     else
     {
         return(BadRequest());
     }
     return(Ok());
 }