Exemple #1
0
        public void DeleteWineFromList(int userId, int vinhoId)
        {
            FavoriteWines favorite = new FavoriteWines(userId, vinhoId);

            context.FavoriteWines.Remove(favorite);
            context.SaveChanges();
        }
Exemple #2
0
 public void AddWineToList(int userId, Wine vinho)
 {
     if (context.FavoriteWines.Find(userId, vinho.VinhoID) == null)
     {
         FavoriteWines favorite = new FavoriteWines(userId, vinho.VinhoID);
         context.FavoriteWines.Add(favorite);
         context.SaveChanges();
     }
 }