Beispiel #1
0
        public async Task <QuestionTypeDto> Insert(QuestionTypeDto request)
        {
            var entity = AutoMapper.Mapper.Map <QuestionType>(request);

            var result = await entityRepository.InsertAsync(entity);

            return(AutoMapper.Mapper.Map <QuestionTypeDto>(result));
        }
Beispiel #2
0
        public async Task <QuestionTypeModel> InsertQuestionTypeAsync(QuestionTypeModel questionType)
        {
            questionType.AddedDate = DateTime.Now;
            var newQuestionType = await questionTypeRepository.InsertAsync(mapper.Map <QuestionType>(questionType));

            await questionTypeRepository.SaveChangesAsync();

            return(mapper.Map <QuestionTypeModel>(newQuestionType));
        }