Esempio n. 1
0
 public IHttpActionResult DeleteTeacher(string id)
 {
     if (teachersService.ExistsID(id) == false)
     {
         return(NotFound());
     }
     return(Ok(teachersService.DeleteTeacher(id)));
 }
Esempio n. 2
0
        public IHttpActionResult DeleteTeacher(int id)
        {
            Teacher teacher = teachersService.DeleteTeacher(id);

            if (teacher == null)
            {
                return(NotFound());
            }

            return(Ok(teacher));
        }
Esempio n. 3
0
        public IHttpActionResult DeleteTeacher(string id)
        {
            Teacher teacher = teachersService.DeleteTeacher(id);

            if (teacher == null)
            {
                return(NotFound());
            }

            logger.Info("Deleting teacher");

            return(Ok(teacher));
        }
        public IHttpActionResult DeleteTeacher(Guid id)
        {
            TeacherDto teacher = new TeacherDto();

            try
            {
                teacher = db.DeleteTeacher(id);
            }
            catch (NullReferenceException e)
            {
                logger.Error(e.Message);
                return(NotFound());
            }
            return(Ok(teacher));
        }
Esempio n. 5
0
        public async Task <IHttpActionResult> DeleteTeacher(int teacherId)
        {
            // this is from accounts
            var userData = IdentityHelper.GetLoggedInUser(RequestContext);

            logger.Trace("Delete User {@teacherId} by {@userData}", teacherId, userData);

            var result = await teachersService.DeleteTeacher(teacherId);

            if (result == null)
            {
                return(NotFound());
            }

            return(Ok(result));
        }
 public void Delete(int id)
 {
     TeachersService.DeleteTeacher(id);
 }