public IActionResult Put([FromBody] CategoryEdit item) { if (item == null) { return(NotFound()); } else if (item.oldname == item.newname) { return(NotFound()); } else { if (catefunction.Put(item)) { return(Ok()); } else { return(NotFound()); } } }