public ActionResult EditSubject(int? id)
        {
            SubjectEditSubjectVM model = new SubjectEditSubjectVM();

            model.Action = "Create";

            if (id != null)
            {
                SubjectRepository subjectRepo = new SubjectRepository();
                Subject subject = subjectRepo.GetAll(filter: s => s.ID == id.Value).FirstOrDefault();

                model.Action = "Edit";
                model.SubjectID = subject.ID;
                model.SubjectName = subject.Name;
            }

            return View(model);
        }
        public ActionResult EditSubject(SubjectEditSubjectVM model)
        {
            if (!ModelState.IsValid)
            {
                return View();
            }

            SubjectRepository subjectRepo = new SubjectRepository();
            Subject subject = new Subject();

            if (model.SubjectID != 0)
            {
                subject = subjectRepo.GetByID(model.SubjectID);
            }

            subject.Name = model.SubjectName;

            subjectRepo.Save(subject);

            return RedirectToAction("ListSubjects", "Subject");
        }