public async Task <IActionResult> Get() { var applicants = await _repo.Get(); var applicantsDto = _mapper.Map <IList <ApplicantDTO> >(applicants); return(Ok(applicantsDto)); }
public async Task <IActionResult> DeleteApplicant(int id) { Applicants Applicant = await _repo.Get(id); _repo.RemoveApplicant(Applicant); await _unitofwork.CompleteAsync(); return(Ok(id)); }
public async Task UpdateApplicant(UpdateApplicantCommand command) { var applicant = await _applicantRepository.Get(command.Id); var modifiedApplicant = Applicant.Instance(applicant, _countryService) .WithName(command.Name) .WithFamily(command.Family) .WithAddress(command.Address) .WithCountryOfOrigin(command.CountryOfOrigin) .WithEmailAddress(command.EmailAddress) .WithAge(command.Age) .WithHired(command.Hired) .Build(); await _applicantRepository.Update(modifiedApplicant); }
public async Task <ApplicantDto> Get(int userId) { var result = await _applicant.Get(userId); int?countryId; if (result.StateId != null) { countryId = await _applicant.GetCountryId(result.StateId); } else { countryId = null; } var applicantDetail = new ApplicantDto { Id = result.Id, FirstName = result.FirstName, LastName = result.LastName, Email = result.Email, DateOfBirth = result.DateOfBirth, Country = countryId, State = result.StateId, Disabled = result.Disabled, Address = result.Address, City = result.City, PostalCode = result.PostalCode, Mobile = result.Mobile, Phone = result.Phone }; return(applicantDetail); }
public async Task <long> GetScoreOfApplicant(long applicantId) { var applicant = await _applicantRepository.Get(applicantId); var activeRules = await _ruleRepository.GetActiveRules(); return(activeRules.Sum(a => a.GetPointsFor(applicant))); }
public Applicant Get(int id) { try { return(_applicantRepository.Get(id).Result); } catch (Exception e) { throw; } }
public void Create(Applicant applicant) { if (applicant == null) { throw new ValidationFailedException (new[] { $"{nameof(applicant)} is null or empty" }); } if (!validator.Validate(applicant, out IEnumerable <string> errors)) { throw new ValidationFailedException(errors); } var present = repo.Get(applicant.ID) != null; if (present) { throw new ApplicantAlreadyExistsException(applicant); } repo.Add(applicant); }
public object GetApplicants() { return(_serializer.Serialize(_repository.Get(), _accessor)); }
public Applicant Get(int id) { _logger.LogInformation("Executing {0} service method for applicant {1}.", nameof(Get), id); return(_repository.Get(id)); }
public async Task <ApplicantViewModel> Get(int id) { return(await _applicantRepository.Get(id)); }
public Applicant Get(int applicantId) { var result = _repository.Get(applicantId); return(result); }
public object Get() { return(_repository.Get()); }