Esempio n. 1
0
        public IActionResult Update(long id, [FromBody] Category category)
        {
            bool result = false;

            try
            {
                if (category == null || category.ID != id)
                {
                    return(BadRequest());
                }
                result = catBL.UpdateCategoryName(id, category);
                if (result == false)
                {
                    return(NotFound());
                }
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception in getting Add new Category", e);
            }
            return(new NoContentResult());
        }