Exemple #1
0
        public ActionResult DeleteApplicant(int id)
        {
            _logger.LogInformation("Accept request to delete applicant info.");
            var response = _manager.DeleteApplicant(id);

            if (response == ReturnCode.Failed)
            {
                return(StatusCode(500));
            }
            else if (response == ReturnCode.Success)
            {
                return(StatusCode(201));
            }
            else
            {
                return(NotFound());
            }
        }
Exemple #2
0
 public ActionResult Delete(int id)
 {
     try {
         var success = _applicantManager.DeleteApplicant(id);
         if (success == 0)
         {
             _logger.LogWarning($"Attempt to delete a non-existing applicant! Applicant with ID: {id} has not been found in the database!");
             return(NotFound());
         }
         else
         {
             _logger.LogInformation($"Applicant wit ID: {id} has been deleted from the database!");
             return(Ok());
         }
     } catch (Exception) {
         _logger.LogError($"Unsuccessful attempt to delete an entry from the database! There was an error while trying to delete an applicant with ID: {id}");
         return(BadRequest());
     }
 }