public IActionResult EditQClass(long id, [FromForm] EditQClassViewModel editQClassViewModel) { if (!ModelState.IsValid) { ModelState.AddModelError(string.Empty, "修改错误"); return(View(editQClassViewModel)); } var qclass = _ExamService.GetQClassById(id); qclass.Explain = editQClassViewModel.Explain; qclass.Class = editQClassViewModel.Class; _ExamService.EditQClass(qclass); return(RedirectToAction(nameof(Index))); }