Esempio n. 1
0
        public IActionResult AddItem(int id, [FromBody] Item item)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var orderService = new DatabaseService(context);
            var order        = orderService.FindOrder(id);

            if (order == null)
            {
                return(NotFound());
            }
            orderService.AddItem(order, item);
            return(Ok());
        }
Esempio n. 2
0
 public void AddItem()
 {
     database.AddItem();
     SetDisplayItem();
 }