public IActionResult Edit(int id) { var emp = lopHocRepository.Get(id); var result = new EditLopHocViewsModels() { Name = emp.LopHocName, Id = emp.LopHocId }; return(View(result)); }
public IActionResult Edit(EditLopHocViewsModels models) { var empl = new LopHoc() { LopHocId = models.Id, LopHocName = models.Name }; if (empl != null) { lopHocRepository.Edit(empl); return(RedirectToAction("Index", new { id = empl.LopHocId })); } return(View(models)); }