예제 #1
0
        public ActionResult DeleteCategorie(int id)
        {
            try
            {
                var categorieDelete = _repository.GetCategorieById(id);
                if (categorieDelete == null)
                {
                    return(NotFound());
                }

                _repository.DeleteCategorie(categorieDelete);
                _repository.SaveChanges();

                return(NoContent());
            }
            catch (Exception)
            {
                return(BadRequest());
            }
        }