Esempio n. 1
0
        public async Task <ActionResult> Get(string name = "")
        {
            var cities = string.IsNullOrEmpty(name) ?
                         await _citiesQueries.GetDefaultCities() :
                         await _citiesQueries.Get(name);

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

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

            return(Ok(cities));
        }