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)));
        }
Esempio n. 2
0
        public HttpResponseMessage CountryList()
        {
            var res = CachedCountryList.GetCountryList(Thread.CurrentThread.CurrentCulture.Name)
                      .Values;

            return(Request.CreateResponse(HttpStatusCode.OK, res));
        }
Esempio n. 3
0
        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)));
        }