Пример #1
0
        public ActionResult <ItemDTO_Return> AddNewitem([FromBody] ItemDTO_Create newitem)
        {
            var result = _itemService.AddNewitemToDatabase(_itemMapper.CreateItemFromitemDTOCreate(newitem));

            if (result == null)
            {
                return(BadRequest("please fill in all required fields"));
            }
            else
            {
                return(Ok(_itemMapper.CreateitemDTOReturnFromitem(result)));
            }
        }