public ActionResult Autocomplete(string term)
        {
            var model = _db.Query <Restaurant>()
                        .Where(r => r.Name.StartsWith(term))
                        .Take(10)
                        .Select(r => new { label = r.Name });

            return(Json(model, JsonRequestBehavior.AllowGet));
        }
Esempio n. 2
0
        //
        // GET: /Restaurant/

        public ActionResult Index()
        {
            //return View(db.Restaurants.ToList());
            return(View(_db.Query <Restaurant>().ToList()));
        }