public int DeleteSchool(int schoolId)
 {
     try
     {
         return(schoolRepository.DeleteSchool(schoolId));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#2
0
        public IActionResult DeleteSchool(int schoolId)
        {
            School school = _schoolRepository.GetSchool(schoolId);

            if (school == null)
            {
                return(NotFound());
            }
            _schoolRepository.DeleteSchool(school);
            return(NoContent());
        }
示例#3
0
        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);
        }
示例#5
0
 public async Task <bool> DeleteSchool(int id)
 {
     return(await _schoolRepository.DeleteSchool(id));
 }
示例#6
0
 public int DeleteSchool(string schoolId)
 {
     return(_repo.DeleteSchool(schoolId));
 }