Ejemplo 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();
     }
 }