public async Task <ActionResult> GetAllCities([FromQuery] CitiesQuery query) { if (query.countryName == null) { ModelState.AddModelError("countryName", "Отсутствует значение параметра"); } if (!ModelState.IsValid) { return(BadRequest(new ResponseError { error = true, message = GetModelStateError() })); } var cities = await _timeZoneCorrector.GetCities(query.countryName, query.stateName, query.districtName); if (cities == null) { return(BadRequest(new ResponseError { error = true, message = "Cities not found" })); } return(Ok(new ResponseResult <List <string> >() { error = false, result = cities })); }
public async Task <List <string> > Handle(CitiesQuery request, CancellationToken cancellationToken) { return(await PersonPerCityCounterRepository.GetCities()); }
public CitiesController(CitiesQuery citiesQueries, ILogger <CitiesController> logger) { _citiesQueries = citiesQueries; _logger = logger; }
public CitiesController(CitiesQuery citiesQueries) { _citiesQueries = citiesQueries; }
public CitiesController(CitiesQuery citiesQuery) { _citiesQuery = citiesQuery; }