public void AddRecipeReviewComment(int Id, ReviewCommentDetail reviewCommentDetail) { RecipeReviewComment recipeReviewComment = new RecipeReviewComment(); recipeReviewComment.Recipe = context.Recipes.First(r => r.RecipeId == Id); recipeReviewComment.ReviewCommentDetail = context.ReviewCommentDetails.First( rrc => rrc.ReviewCommentId == reviewCommentDetail.ReviewCommentId); recipeReviewComment.Recipe.RecipeReviewComments.Add(recipeReviewComment); context.SaveChanges(); }
public void DeleteRecipeReviewComment(RecipeReviewComment recipeReviewComment) { context.RecipeReviewComments.Remove(recipeReviewComment); context.SaveChanges(); }