Пример #1
0
        public IActionResult Search(string query)
        {
            string pattern = "(" + query + ")";

            IList <Course> courses = _repos.Courses
                                     .ListWith("School", "Units")
                                     .Where(Predicates.Course(query))
                                     .ToList();

            return(Ok(courses));
        }
Пример #2
0
        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));
        }