示例#1
0
        public SavedFeedsVM DisplaySavedFeeds(int userId)
        {
            savedFeedRepository = new SavedFeedRepository(new FeedContext());

            SavedFeedsVM savedFeedsVM = new SavedFeedsVM()
            {
                savedFeedItems = savedFeedRepository.FindBy(x => x.userId == userId).ToList()
            };

            return(savedFeedsVM);
        }
示例#2
0
        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);
        }