示例#1
0
        // GET: api/RESTOrders
        public IHttpActionResult GetOrders()
        {
            var orders = _service.getAllOrders().ToList();

            if (orders == null)
            {
                return(NotFound());
            }

            // db.Entry(contact).Collection(c => c.Orders).Load();

            return(Ok(orders));
        }
        public JsonResult AutoComplete(string prefix)
        {
            var allOrders = svc.getAllOrders();


            var orders = (from o in allOrders
                          where o.OrderDescription.StartsWith(prefix)
                          select new
            {
                label = o.OrderDescription,
                val = o.OrderId
            }).ToList();

            return(Json(orders));
        }