public ActionResult EditSubjects(int id, AdminControllerSubjectVM subjectModel)
        {
            TryUpdateModel(subjectModel);
            if (ModelState.IsValid)
            {

                Subject subject = null;
                SubjectRepository subjectRepository = new SubjectRepository();
                if (id > 0)
                {
                    subject = subjectRepository.GetById(id);
                    subject.Name = subjectModel.Name;
                    subjectRepository.Save(subject);
                    return RedirectToAction("ManageSubjects");
                }
                else
                {
                    subject = subjectRepository.GetAll(filter: s => s.Name == subjectModel.Name).FirstOrDefault();
                    if (subject == null)
                    {
                        subject = new Subject();
                        subject.Name = subjectModel.Name;
                        subjectRepository.Save(subject);
                        return RedirectToAction("ManageSubjects");
                    }
                    else
                    {
                        throw new ArgumentException("Invalid subject name");
                    }
                }
            }
            return View(subjectModel);
        }
        public ActionResult ManageSubjects()
        {
            SubjectRepository subjectRepository = new SubjectRepository();
            AdminControllerSubjectVM subjectModel = new AdminControllerSubjectVM();
            subjectModel.subjectList = subjectRepository.GetAll();

            return View(subjectModel);
        }
        public ActionResult EditSubjects(int id)
        {
            Subject subject = new Subject();
            SubjectRepository subjectRepository = new SubjectRepository();
            AdminControllerSubjectVM subjectModel = new AdminControllerSubjectVM();

            if (id > 0)
            {
                subject = subjectRepository.GetById(id);
                subjectModel.Name = subject.Name;
                subjectModel.SubjectID = id;
            }
            if (id == 0)
            {
                subject.Name = subjectModel.Name;
            }
            return View(subjectModel);
        }