Exemple #1
0
        public async Task <InterviewTemplateDto> CreateInterviewTemplate(InterviewTemplateDto interviewTemplateDto)
        {
            var interviewTemplate        = _Mapper.Map <InterviewTemplate>(interviewTemplateDto);
            var createdInterviewTemplate = await _InterviewTemplateRepository.InsertInterviewTemplate(interviewTemplate);

            var responseInterviewTemplate = _Mapper.Map <InterviewTemplateDto>(createdInterviewTemplate);

            if (interviewTemplate.Questions != null)
            {
                await _InterviewTemplateRepository.InsertInterviewTemplateQuestions(createdInterviewTemplate.Id, interviewTemplate.Questions.Select(q => q.Id));

                responseInterviewTemplate.QuestionIds = interviewTemplateDto.QuestionIds;
            }

            return(responseInterviewTemplate);
        }
Exemple #2
0
        public async Task <InterviewTemplate> CreateInterviewTemplate()
        {
            var interviewTemplate =
                _Fixture.Build <InterviewTemplate>()
                .Without(o => o.Questions)
                .Without(o => o.Id)
                .Create();

            interviewTemplate = await _InterviewTemplateRepository.InsertInterviewTemplate(interviewTemplate);

            interviewTemplate.Questions = await CreateQuestions();

            await _InterviewTemplateRepository.InsertInterviewTemplateQuestions(
                interviewTemplate.Id,
                interviewTemplate.Questions.Select(q => q.Id));

            return(interviewTemplate);
        }