Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Update(SubjectUpdateBindingModel model)
        {
            await this.subjectsService.UpdateAsync(model);

            return(this.RedirectToAction("index"));
        }