public JsonResult GetPatientAutoComplete(string query) { var patients = _patientServices.GetPatientAutoComplete().Where(t => t.PatientName.Contains(query)) .OrderBy(t => t.PatientName).Take(10).ToList(); return(Json(patients, JsonRequestBehavior.AllowGet)); }