public int DeleteSchool(int schoolId) { try { return(schoolRepository.DeleteSchool(schoolId)); } catch (Exception ex) { throw ex; } }
public IActionResult DeleteSchool(int schoolId) { School school = _schoolRepository.GetSchool(schoolId); if (school == null) { return(NotFound()); } _schoolRepository.DeleteSchool(school); return(NoContent()); }
public async Task <ActionResult <School> > DeleteSchool(int schoolId, School school) { try { if (schoolId != school.Id) { return(BadRequest("Id Mismatch")); } var schoolDelete = await _schoolRepository.GetSchool(schoolId); if (schoolDelete == null) { return(NotFound($"School Id = {schoolId} Not Found")); } return(await _schoolRepository.DeleteSchool(schoolId)); } catch (Exception e) { return(StatusCode(StatusCodes.Status500InternalServerError, "Error in Retrieving Data from Database")); } }
public void DeleteSchool(Guid id) { var schoolEntity = _schoolRepository.ReadSchool(id); _schoolRepository.DeleteSchool(schoolEntity); }
public async Task <bool> DeleteSchool(int id) { return(await _schoolRepository.DeleteSchool(id)); }
public int DeleteSchool(string schoolId) { return(_repo.DeleteSchool(schoolId)); }