public async Task <IActionResult> GetCity([FromQuery] SearchKey searchKey, CancellationToken cancellationToken) { if (searchKey == null) { return(BadRequest()); } var result = !string.IsNullOrEmpty(searchKey.City) ? await _weatherService.GetByCity(searchKey.City, cancellationToken) : await _weatherService.GetByZipCide(searchKey.ZipCode, cancellationToken); return(Ok(result)); }