public ActionResult Edit(ViewModels.Timetable model, int id) { if (ModelState.IsValid) { var dbModel = timetableRepository.GetById(id); dbModel.StartTime = model.StartTime; // dbModel.CategoryId = model.CategoryId; dbModel.StudioId = model.StudioId; dbModel.ClassTypeId = model.ClassTypeId; dbModel.UserId = model.UserId; dbModel.Date = model.Date; dbModel.IsActive = model.isActive; //timetableRepository.Update(dbModel); //unitofWork.Commit(); timeTableService.EditTimetable(dbModel); } return(RedirectToAction("Index")); }