Пример #1
0
        public IActionResult Delete(int Id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            try
            {
                return(Ok(_enterpriseRepository.Delete(Id)));
            }
            catch
            {
                return(BadRequest(ModelState)); //or you can throw new Exception
            }
        }