public async Task <IActionResult> AddSubject(SubjectScoreViewModel model) { ModelState.Clear(); await model.InitAsync(_dbContext); return(View(model)); }
public async Task <IActionResult> EditSubject(SubjectScoreViewModel model) { var subject = _dbContext.SubjectScores .Include(x => x.Subject) .Include(x => x.EducationalDirection) .FirstOrDefault(x => x.Id == model.Id); if (subject == null) { return(NotFound("EditSubject", model.Id)); } await model.InitAsync(subject, _dbContext); return(View("AddSubject", model)); }