public async Task <ActionResult> Get(string name = "")
        {
            var cities = string.IsNullOrEmpty(name) ?
                         await _citiesQueries.GetDefaultCities() :
                         _citiesQueries.GetDefaultCities().Result
                         .Where(city => city.Name.StartsWith(name));

            return(Ok(cities));
        }
        public async Task <ActionResult> Get(string name = "")
        {
            var cities = string.IsNullOrEmpty(name) ?
                         await _citiesQueries.GetDefaultCities() :
                         _citiesQueries.GetDefaultCities().Result
                         .Where(city => city.Name.StartsWith(name));

            if (cities.Count() == 0)
            {
                _logger.LogWarning("City search {0} returned 0 results.", name);
            }

            return(Ok(cities));
        }
Ejemplo n.º 3
0
        public async Task <ActionResult> Get(string name = "")
        {
            var cities = string.IsNullOrEmpty(name) ?
                         await _citiesQueries.GetDefaultCities() :
                         await _citiesQueries.Get(name);

            return(Ok(cities));
        }