コード例 #1
0
        public JsonResult GetCitiesSelect2()
        {
            var term  = HttpContext.Request.Query["q"];
            var lista = _cityServices.FindAll(term).Select(city => new { Value = city.Id.ToString(), Text = $"{city.Name} - {city.State.Initials}" });

            return(Json(lista));
        }