public ActionResult <InventoryItems> AddInventoryItems(InventoryItems items)
        {
            var inventoryItems = _services.AddInvetoryItems(items);

            if (inventoryItems == null)
            {
                return(NotFound());
            }
            return(inventoryItems);
        }
Пример #2
0
        public ActionResult <InventoryItem> AddInventoryItems(InventoryItem items)
        {
            try
            {
                var inventoryItems = _services.AddInvetoryItems(items);

                if (inventoryItems == null)
                {
                    return(NotFound());
                }

                return(Ok(inventoryItems));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
                // TODO: log the error
            }
        }