Exemplo n.º 1
0
        public bool DeleteFavorite(string cityId)
        {
            FavoriteCity city = new FavoriteCity();

            city.Id = Convert.ToInt32(cityId);
            return(_repo.DeleteFavorite(city));
        }
 private void AddOrRemoveFavoriteCity()
 {
     if (!IsBusy)
     {
         City.Favorited = !City.Favorited;
         var favoriteCity = new FavoriteCity(City.Id);
         if (City.Favorited)
         {
             _cityRegistrationService.SaveFavoriteCityAsync(favoriteCity);
         }
         else
         {
             _cityRegistrationService.DeleteFavoriteCityAsync(favoriteCity);
         }
         RaisePropertyChanged("City");
     }
 }
Exemplo n.º 3
0
 public Response AddToFavorites([FromBody] FavoriteCity city)
 {
     return(_weatherBl.AddFavorite(city));
 }
 public Task <int> DeleteFavoriteCityAsync(FavoriteCity favoriteCity) => _database.DeleteAsync(favoriteCity);
 public Task <int> SaveFavoriteCityAsync(FavoriteCity favoriteCity) => _database.InsertAsync(favoriteCity);
Exemplo n.º 6
0
 public Response AddFavorite(FavoriteCity city)
 {
     return(_repo.AddFavorite(city));
 }