public IActionResult CreateCauHoi(CauHoiDTO cauHoi) { if (ModelState.IsValid) { cauHoi.Id = 0; cauHoi.IdbaiKiemTra = baiHocService.GetIDBaiKiemTra(); baiHocService.CreateCauHoi(cauHoi); return(RedirectToAction("CreateCauHoi")); } return(View(cauHoi)); }
public void CreateCauHoi(CauHoiDTO cauHoi) { baiHocRepository.AddCauHoi(iMapper.Map <CauHoiDTO, CauHoi>(cauHoi)); }