public void DeleteComment(int id) { // Find comment with the matching id Comment comment = context.Comment.First(comment => comment.CommentID == id); // Remove from context and save changes context.Remove(comment); context.SaveChanges(); }
public void DeleteStory(int id) { // Find the story with a matching id Story story = context.Story.First(story => story.StoryID == id); // Remove story from context and save changes context.Remove(story); context.SaveChanges(); }