Esempio n. 1
0
 public SuccessResponse Delete(DeleteDiseaseRequest request)
 {
     try
     {
         var disease = _diseaseRepository.FindBy(request.Id);
         disease.ThrowExceptionIfRecordIsNull();
         var isReference = _diseaseRepository.IsReference(request.Id);
         isReference.ThrowExceptionIfIsReference();
         _diseaseRepository.Remove(disease);
         return(new SuccessResponse {
             IsSuccess = true
         });
     }
     catch (DataAccessException)
     {
         throw new ApplicationException();
     }
 }
Esempio n. 2
0
 public IActionResult Delete(int id)
 {
     _diseaseRepository.Remove(id);
     return(Ok());
 }