public JsonResult JsonGetLocations(string searchPattern) { var list = new List <City>(); if (!string.IsNullOrWhiteSpace(searchPattern)) { list = _geoService.GetCities(new CityRequest() { Name = searchPattern }).ToList(); } return(Json(list.Select(l => new { Text = string.Format("{0}, {1}", l.Name, l.StateProvince.Name), Value = string.Format("{0}, {1}", l.Name, l.StateProvince.Name) }))); }
public async Task <List <City> > Cities(string countryCode) { _LogService = new LogService(); _LogService.LogInfo($"------------ CITY: countries/{countryCode}/cities ----------"); return(await _GeoService.GetCities(countryCode)); }