Ejemplo n.º 1
0
 private List <Person> GetByZip(String zip)
 {
     System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
     sw.Start();
     Models.ConnectionString context = new Models.ConnectionString();
     sw.Stop();
     result.Performance.ElapsedTime = sw.Elapsed;
     return(context.People.Where(e => e.zip == zip).ToList <Models.Person>());
 }
Ejemplo n.º 2
0
        public JsonResult SearchText(String SearchString)
        {
            System.Diagnostics.Stopwatch sw      = new System.Diagnostics.Stopwatch();
            Models.ConnectionString      context = new Models.ConnectionString();

            sw.Start();
            result.People = context.People.Where(e => e.json_data.Contains(SearchString)).ToList <Models.Person>();
            sw.Stop();

            result.Performance.ElapsedTime = Helper.ToReadbileTime(sw.ElapsedTicks);

            if (result != null && result.People != null)
            {
                result.Count = result.People.Count;
                if (result.Count > 1000)
                {
                    result.People = null;
                }
            }
            return(Json(result, JsonRequestBehavior.AllowGet));
            //Request.CreateResponse(HttpStatusCode.OK, result);
        }