// //SubjectListToSubjectViewList: // List<SubjectView> SubjectListToSubjectViewList(List<Subject> subjectList) { List<SubjectView> subjectViewList = new List<SubjectView>(); foreach (Subject subject in subjectList) { //convert every subject to SubjectView SubjectView subjectView = new SubjectView(subject, IdSpliter); //add to subject to the list subjectViewList.Add(subjectView); } return subjectViewList; }
// // GET: /Subject/DeleteSubject // public ActionResult DeleteSubject() { List<Subject> subjectList = _subjectDbContext.dbSet.ToList(); List<SubjectView> subjectViewList = new List<SubjectView>(); foreach (Subject subject in subjectList) { //convert every subject to SubjectView SubjectView subjectView= new SubjectView(subject, IdSpliter); //add to subject to the list subjectViewList.Add(subjectView); } return View(subjectViewList); }