public void DeleteWineFromList(int userId, int vinhoId) { FavoriteWines favorite = new FavoriteWines(userId, vinhoId); context.FavoriteWines.Remove(favorite); context.SaveChanges(); }
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(); } }