Esempio n. 1
0
        public ActionResult Post([FromBody] Order newOrder)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var item = _service.Add(newOrder);

            //Send the message to the queue
            _messageQueue.SendMessage(JsonConvert.SerializeObject(newOrder));

            return(CreatedAtAction("Get", new { id = item.orderid }, item));
        }