示例#1
0
 public ActionResult AddNewItem([FromBody] NewItemDTO givenItem)
 {
     try
     {
         _itemService.AddNewItem(_itemMapper.DTOToItem(givenItem));
         return(Ok());
     }
     catch (ItemException ItemEx)
     { return(BadRequest(ItemEx.Message)); }
     catch (Exception ex)
     { return(BadRequest(ex.Message)); }
 }