示例#1
0
        public string MoveInstagramFeedToMongo()
        {
            InstagramFeedRepository twtfeedrepo = new InstagramFeedRepository();
            string          output    = string.Empty;
            bool            exit      = true;
            int             skip      = 0;
            MongoRepository mongorepo = new MongoRepository("InstagramFeed");

            while (exit)
            {
                List <Domain.Socioboard.Domain.InstagramFeed> fbmsgs = twtfeedrepo.getAllInstagramFeedMongo(skip);
                if (fbmsgs.Count() == 0)
                {
                    exit = false;
                }

                foreach (var item in fbmsgs)
                {
                    Domain.Socioboard.MongoDomain.InstagramFeed mfbmsg = new Domain.Socioboard.MongoDomain.InstagramFeed();
                    mfbmsg.Id = MongoDB.Bson.ObjectId.GenerateNewId();
                    //  mfbmsg.EntryDate = item.EntryDate.ToString();
                    mfbmsg.AdminUser    = item.AdminUser;
                    mfbmsg.CommentCount = item.CommentCount;
                    mfbmsg.Feed         = item.Feed;
                    mfbmsg.FeedId       = item.FeedId;
                    mfbmsg.FeedDate     = item.FeedDate;
                    mfbmsg.FeedId       = item.FeedId;
                    mfbmsg.InstagramId  = item.InstagramId;
                    mfbmsg.strId        = item.Id.ToString();
                    mfbmsg.FeedImageUrl = item.FeedImageUrl;
                    mfbmsg.FeedUrl      = item.FeedUrl;
                    mfbmsg.FromId       = item.FromId;
                    mfbmsg.ImageUrl     = item.ImageUrl;
                    mfbmsg.InstagramId  = item.InstagramId;
                    mfbmsg.IsLike       = item.IsLike;
                    mfbmsg.LikeCount    = item.LikeCount;
                    mfbmsg.strId        = item.Id.ToString();
                    mongorepo.Add <Domain.Socioboard.MongoDomain.InstagramFeed>(mfbmsg);
                }
                skip = skip + 50;
            }

            return(output);
        }
        public string MoveInstagramFeedToMongo()
        {
            InstagramFeedRepository twtfeedrepo = new InstagramFeedRepository();
            string output = string.Empty;
            bool exit = true;
            int skip = 0;
            MongoRepository mongorepo = new MongoRepository("InstagramFeed");

            while (exit)
            {
                List<Domain.Socioboard.Domain.InstagramFeed> fbmsgs = twtfeedrepo.getAllInstagramFeedMongo(skip);
                if (fbmsgs.Count() == 0)
                {
                    exit = false;
                }

                foreach (var item in fbmsgs)
                {
                    Domain.Socioboard.MongoDomain.InstagramFeed mfbmsg = new Domain.Socioboard.MongoDomain.InstagramFeed();
                    mfbmsg.Id = MongoDB.Bson.ObjectId.GenerateNewId();
                    //  mfbmsg.EntryDate = item.EntryDate.ToString();
                    mfbmsg.AdminUser = item.AdminUser;
                    mfbmsg.CommentCount = item.CommentCount;
                    mfbmsg.Feed = item.Feed;
                    mfbmsg.FeedId = item.FeedId;
                    mfbmsg.FeedDate = item.FeedDate;
                    mfbmsg.FeedId = item.FeedId;
                    mfbmsg.InstagramId = item.InstagramId;
                    mfbmsg.strId = item.Id.ToString();
                    mfbmsg.FeedImageUrl = item.FeedImageUrl;
                    mfbmsg.FeedUrl = item.FeedUrl;
                    mfbmsg.FromId = item.FromId;
                    mfbmsg.ImageUrl = item.ImageUrl;
                    mfbmsg.InstagramId = item.InstagramId;
                    mfbmsg.IsLike = item.IsLike;
                    mfbmsg.LikeCount = item.LikeCount;
                    mfbmsg.strId = item.Id.ToString();
                    mongorepo.Add<Domain.Socioboard.MongoDomain.InstagramFeed>(mfbmsg);
                }
                skip = skip + 50;
            }

            return output;
        }