public async Task UpdateTestBaseAsync(TestBaseDto testBaseDto) { var testBaseEntity = TestBaseMapper.Map(testBaseDto); _unitOfWork.TestBaseRepository.Update(testBaseEntity); await _unitOfWork.CommitAsync(); }
public CraftedTest(User user, TestBaseDto testBaseDto) { User = user; TestBaseDto = testBaseDto; Date = DateTime.UtcNow; Score = 0; Questions = new List <QuestionDto>(); }
public async Task <IActionResult> Edit(TestBaseDto testBaseDto) { if (ModelState.IsValid) { await _testBaseService.UpdateTestBaseAsync(testBaseDto); return(RedirectToAction(nameof(Index))); } var topics = await _topicService.GetAllTopicsAsync(); ViewData["TopicId"] = new SelectList(topics, "Id", "Name", testBaseDto.TopicId); return(View(testBaseDto)); }