示例#1
0
        public async Task <bool> UpdateEntityByIdAsync(QuestionDto request, int id)
        {
            var entity  = ConvertService.ConvertToStringAnswers(request, _mapper);
            var updated = await _uow.QuestionRepository.UpdateAsync(entity);

            return(await _uow.SaveAsync());
        }
示例#2
0
        public async Task <QuestionDto> CreateEntityAsync(QuestionDto request)
        {
            var entity = ConvertService.ConvertToStringAnswers(request, _mapper);

            entity = await _uow.QuestionRepository.CreateAsync(entity);

            var result = await _uow.SaveAsync();

            request.Id = entity.Id;
            return(!result || entity == null ? null : request);
        }