public ActionResult Delete(string id = null) { CourseList cList = new CourseList(); List <CourseClass> obj = cList.GetCourseClasses(id); return(View(obj.FirstOrDefault())); }
// GET: Course public ActionResult Index(string strSearch) { CourseList cList = new CourseList(); List <CourseClass> obj = cList.GetCourseClasses(string.Empty).OrderBy(x => x.Id_Course).ToList(); if (!string.IsNullOrEmpty(strSearch)) { obj = obj.Where(x => x.Name.Contains(strSearch)).ToList(); } @ViewBag.strSearch = strSearch; return(View(obj)); }