public async Task <ActionResult> DeleteMentor(int id)
        {
            var response = await _mentorRepository.DeleteMentor(id);

            if (response.IsError)
            {
                return(NotFound(response.Message));
            }

            return(Ok());
        }
Example #2
0
        public IActionResult Delete([FromBody] MentorUserDetails mentorToDelete)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            if (mentorToDelete == null)
            {
                ModelState.AddModelError("", "Can't find client.");
                return(StatusCode(500, ModelState));
            }

            if (!_mentorRepository.DeleteMentor(mentorToDelete))
            {
                ModelState.AddModelError("", "Something went wrong deleting client.");
                return(StatusCode(500, ModelState));
            }

            return(NoContent());
        }
Example #3
0
 public void Delete(long id)
 {
     _repository.DeleteMentor(id);
 }
Example #4
0
 public void Delete(int id)
 {
     _repository.DeleteMentor(id);
 }