public ActionResult SearchResult(string query) { //get courses based on query var result = courseRepo.getData(); result = result.Where(e => e.CourseName.Contains(query)).ToList(); //store logged in user data in viewbag if (User != null && User.IsInRole("Student")) { string userId = User.Identity.GetUserId(); Student user = context.Students.Where(e => e.UserId == userId).FirstOrDefault(); ViewBag.loggedInUser = user.StudentRowId; } return(View(result)); }
// GET: Product public ActionResult Index() { var result = productRepo.getData(); return(View(result)); }
// GET: Student public ActionResult Index() { var result = studentRepo.getData(); return(View(result)); }
// GET: Trainer public ActionResult Index() { var result = trainerRepo.getData(); return(View(result)); }
// GET: Course public ActionResult Index() { var result = courseRepo.getData(); return(View(result)); }
// GET: AreaOfInterest public ActionResult Index() { var result = areaOfInterestRepo.getData(); return(View(result)); }