public async Task <ActionResult> Edit(Teacher model) { if (ModelState.IsValid) { try { var o = th.GetById(model.Id); o.Address = model.Address; o.Lastname = model.Lastname.ToUpper(); o.Firstname = model.Firstname.ToUpper(); o.Gender = model.Gender; o.Email = model.Email; o.PhoneNumber = model.PhoneNumber; o.ModifiedDate = DateTime.UtcNow.Date; o.Salary = model.Salary; th.Update(o); await th.SaveChangesAsync(); return(RedirectToAction("Details", new RouteValueDictionary( new { controller = "Teacher", action = "Details", Id = o.Id }))); } catch (DbUpdateConcurrencyException) { if (!th.IfExists(model.Id)) { return(NotFound()); } else { throw; } } } return(View(model)); }