public void deleteFavouriteRecipe(int FID) { Favourite dbEntry = context.FavRecipe.FirstOrDefault(p => p.FavID == FID); if (dbEntry != null) { context.FavRecipe.Remove(dbEntry); context.SaveChanges(); } }
public void addFavRecipe(Favourite fav) { Favourite newFav = new Favourite(); newFav.RecID = fav.RecID; newFav.fvname = fav.fvname; newFav.user = fav.user; context.Add(newFav); context.SaveChanges(); }