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()); }
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); }