Пример #1
0
 public ActionResult <IEnumerable <ApplicantDTO> > Get()
 {
     try
     {
         return(_repo.GetAllApplicants());
     }
     catch (Exception ex)
     {
         _logger.LogInformation($"Failed to retrieve records, Error {ex.Message}");
         return(BadRequest(ex.Message));
     }
 }
Пример #2
0
        public async Task <IActionResult> GetApplicants()
        {
            _logger.LogInformation("\t\n\n=========================================================================\n\nAccessing the Endpoint for Getting all Applicant");

            try
            {
                var applicants = await _appRepository.GetAllApplicants();

                if (applicants != null)
                {
                    _logger.LogInformation("Successful Get call was made");
                    return(Ok(new ResponseModel(200, "Success", applicants)));
                }
                _logger.LogInformation("Failed");
                return(NotFound(new ResponseModel(404, "Applicant does not exist", null)));
            }
            catch (Exception ex)
            {
                _logger.LogInformation("An Error occured in the GetAllApplicants endpoint", ex);
                return(BadRequest(new ResponseModel(400, "Some Error occuredl!!! Please Try again", null)));
            }
        }
 public IEnumerable <Applicant> GetAllApplicants()
 {
     return(_applicantRepository.GetAllApplicants());
 }
Пример #4
0
        public async Task <IEnumerable <ApplicantResource> > GetApplicants()
        {
            List <Applicants> Applicants = await _repo.GetAllApplicants();

            return(_mapper.Map <List <Applicants>, List <ApplicantResource> >(Applicants));
        }