public async Task UpdateAsync(SubjectUpdateBindingModel model) { Subject subject = this.GetById(model.Id); bool isSubjectNull = subject == null; if (isSubjectNull) { return; } subject.Name = model.Name; this.dbContext.Subjects.Update(subject); await this.dbContext.SaveChangesAsync(); }
public async Task <IActionResult> Update(SubjectUpdateBindingModel model) { await this.subjectsService.UpdateAsync(model); return(this.RedirectToAction("index")); }