public HttpResponseMessage Countries() { string searchString = HttpContext.Current.Request.Params["SearchString"].NormalizeString(); CachedCountryList countries = CachedCountryList.GetCountryList(System.Threading.Thread.CurrentThread.CurrentCulture.Name); return(Request.CreateResponse(HttpStatusCode.OK, countries.Values.Where(x => x.NormalizedFullName.IndexOf(searchString) > -1).OrderBy(x => x.NormalizedFullName))); }
public HttpResponseMessage CountryList() { var res = CachedCountryList.GetCountryList(Thread.CurrentThread.CurrentCulture.Name) .Values; return(Request.CreateResponse(HttpStatusCode.OK, res)); }
public HttpResponseMessage Countries() { var searchString = (HttpContext.Current.Request.Params["SearchString"] ?? "").NormalizeString(); var countries = CachedCountryList.GetCountryList(Thread.CurrentThread.CurrentCulture.Name); return(Request.CreateResponse(HttpStatusCode.OK, countries.Values.Where( x => x.NormalizedFullName.IndexOf(searchString, StringComparison.CurrentCulture) > -1).OrderBy(x => x.NormalizedFullName))); }