Exemple #1
0
 public WeatherVM()
 {
     Weather        = new AccuWeather();
     Cities         = new ObservableCollection <CityForList>();
     SelectedResult = new CityForList();
     RefreshCommand = new RefreshCommand(this);
 }
    public async Task <IActionResult> Cities(Guid id, CancellationToken token)
    {
        token.ThrowIfCancellationRequested();
        if (id.IsEmpty())
        {
            return(NotFound());
        }
        City city = await _cityRepository.GetAsync(id, token);

        token.ThrowIfCancellationRequested();
        if (city == null)
        {
            return(NotFound(id));
        }
        CityForList cityForList = _mapper.Map <CityForList>(city);

        return(Ok(cityForList));
    }