public async Task <ActionResult> DeleteMentor(int id) { var response = await _mentorRepository.DeleteMentor(id); if (response.IsError) { return(NotFound(response.Message)); } return(Ok()); }
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()); }
public void Delete(long id) { _repository.DeleteMentor(id); }
public void Delete(int id) { _repository.DeleteMentor(id); }