コード例 #1
0
        public void deleteFavouriteRecipe(int FID)
        {
            Favourite dbEntry = context.FavRecipe.FirstOrDefault(p => p.FavID == FID);

            if (dbEntry != null)
            {
                context.FavRecipe.Remove(dbEntry);
                context.SaveChanges();
            }
        }
コード例 #2
0
        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();
        }