public IActionResult Search(string query) { string pattern = "(" + query + ")"; IList <Course> courses = _repos.Courses .ListWith("School", "Units") .Where(Predicates.Course(query)) .ToList(); return(Ok(courses)); }
public IActionResult Search(string q) { ViewBag.Action = "Courses"; ViewBag.Query = q; string pattern = "(" + q + ")"; _watch.Start(); IList <Course> courses = _repos.Courses .ListWith("Units") .Where(Predicates.Course(q)) .ToList(); _watch.Stop(); ViewBag.timespan = _watch.Elapsed; _watch.Reset(); ViewBag.Notifications = this.GetNotifications(); return(View(courses)); }