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 DeleteReviewCommentDetail(ReviewCommentDetail reviewCommentDetail) { context.ReviewCommentDetails.Remove(reviewCommentDetail); context.SaveChanges(); }
public void AddReviewCommentDetail(ReviewCommentDetail reviewCommentDetail) { context.ReviewCommentDetails.Add(reviewCommentDetail); context.SaveChanges(); }