Пример #1
0
        public IActionResult DeleteTeacher(int Id)
        {
            if (Id < 0)
            {
                return(BadRequest());
            }

            _teacherRepo.DeleteTeacher(Id);

            return(Ok());
        }
        public HttpResponseMessage Delete(int id)
        {
            try
            {
                _teacher.DeleteTeacher(id);
                var response = new HttpResponseMessage()
                {
                    StatusCode = HttpStatusCode.OK
                };

                return(response);
            }
            catch (Exception)
            {
                var response = new HttpResponseMessage()
                {
                    StatusCode = HttpStatusCode.InternalServerError
                };
                return(response);
            }
        }
Пример #3
0
 public void Delete(int id)
 {
     objteacher.DeleteTeacher(id);
 }