예제 #1
0
 public IList<FeedItem> FetchFeedItems(IList<Feed> feeds)
 {
     FeedManager feedManager = new FeedManager();
     foreach (Feed feed in feeds)
     {
         IEntity entity = FromFeed(feed);
         feedManager.AddFeedItem(feed, entity);
     }
     return feedManager.GetItems();
 }
예제 #2
0
 public IList<FeedItem> LoadFeedItems(int userId, int start, int size)
 {
     if (start < 0)
         start = 0;
     if (size < 1)
         size = 5;
     IList<Feed> feeds = feedRepo.GetUserFeeds(userId, start, size);
     FeedManager feedManager = new FeedManager();
     foreach (Feed feed in feeds)
     {
         IEntity entity = null;
         switch (feed.TypeId)
         {
             case NSNType.USER_TWEET:
                 entity = userTweetRepo.FindById(feed.ItemId);
                 break;
             case NSNType.PHOTO_ALBUM:
                 entity = photoAlbumRepo.FindById(feed.ItemId);
                 break;
             case NSNType.PHOTO:
                 entity = photoAlbumRepo.FindById(feed.ItemId);
                 break;
             case NSNType.FRIEND:
                 entity = friendRepo.FindById(feed.ItemId);
                 break;
         }
         feedManager.AddFeedItem(feed, entity);
     }
     return feedManager.GetItems();
 }