public SavedFeedsVM DisplaySavedFeeds(int userId) { savedFeedRepository = new SavedFeedRepository(new FeedContext()); SavedFeedsVM savedFeedsVM = new SavedFeedsVM() { savedFeedItems = savedFeedRepository.FindBy(x => x.userId == userId).ToList() }; return(savedFeedsVM); }
public SavedFeedsVM DeleteSavedFeed(int userId, int Id) { savedFeedRepository = new SavedFeedRepository(new FeedContext()); var deletedEntity = savedFeedRepository.FindBy(x => x.userId == userId && x.Id == Id).FirstOrDefault(); savedFeedRepository.Erase(deletedEntity); SavedFeedsVM savedFeedsVM = new SavedFeedsVM() { savedFeedItems = savedFeedRepository.FindBy(x => x.userId == userId).ToList() }; return(savedFeedsVM); }