コード例 #1
0
        public void DeleteReviewById(int userId, int recipeId)
        {
            IQueryable <Entities.Review> reviews = from r in _context.Review
                                                   where r.UserId == userId & r.RecipeId == recipeId
                                                   select r;

            Entities.Review review = reviews.FirstOrDefault();
            _context.Remove(review);
        }
コード例 #2
0
 public void DeleteIngredientById(int id)
 {
     Entities.Ingredient ingredient = _context.Ingredient.Find(id);
     _context.Remove(ingredient);
 }