コード例 #1
0
        public FindCandidateDto PostCandidate(CreateCandidateDto cand)
        {
            Candidate candidatModel   = TransformDtoToModel(cand);
            Candidate candidatCreated = candidateRepository.Create(candidatModel);

            return(TransformModelToDto(candidatCreated));
        }
コード例 #2
0
        public async Task <Candidate> Create(Candidate candidate)
        {
            _loggerManager.LogInfo($"Creating new candidate with id {candidate.Id.ToString()}");
            var returnedCandidate = await _candidateRepository.Create(candidate);

            if (returnedCandidate == null)
            {
                _loggerManager.LogError("unable to create candidate");
            }
            return(returnedCandidate);
        }