Exemplo n.º 1
0
        public string MoveInstagramCommentToMongo()
        {
            InstagramCommentRepository twtfeedrepo = new InstagramCommentRepository();
            string          output    = string.Empty;
            bool            exit      = true;
            int             skip      = 0;
            MongoRepository mongorepo = new MongoRepository("InstagramComment");

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

                foreach (var item in fbmsgs)
                {
                    Domain.Socioboard.MongoDomain.InstagramComment mfbmsg = new Domain.Socioboard.MongoDomain.InstagramComment();
                    mfbmsg.Id = MongoDB.Bson.ObjectId.GenerateNewId();
                    //  mfbmsg.EntryDate = item.EntryDate.ToString();
                    mfbmsg.Comment        = item.Comment;
                    mfbmsg.CommentDate    = item.CommentDate;
                    mfbmsg.CommentId      = item.CommentId;
                    mfbmsg.FeedId         = item.FeedId;
                    mfbmsg.FromName       = item.FromName;
                    mfbmsg.FromProfilePic = item.FromProfilePic;
                    mfbmsg.InstagramId    = item.InstagramId;
                    mfbmsg.strId          = item.Id.ToString();

                    mongorepo.Add <Domain.Socioboard.MongoDomain.InstagramComment>(mfbmsg);
                }
                skip = skip + 50;
            }

            return(output);
        }
        public string MoveInstagramCommentToMongo()
        {
            InstagramCommentRepository twtfeedrepo = new InstagramCommentRepository();
            string output = string.Empty;
            bool exit = true;
            int skip = 0;
            MongoRepository mongorepo = new MongoRepository("InstagramComment");

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

                foreach (var item in fbmsgs)
                {
                    Domain.Socioboard.MongoDomain.InstagramComment mfbmsg = new Domain.Socioboard.MongoDomain.InstagramComment();
                    mfbmsg.Id = MongoDB.Bson.ObjectId.GenerateNewId();
                    //  mfbmsg.EntryDate = item.EntryDate.ToString();
                    mfbmsg.Comment = item.Comment;
                    mfbmsg.CommentDate = item.CommentDate;
                    mfbmsg.CommentId = item.CommentId;
                    mfbmsg.FeedId = item.FeedId;
                    mfbmsg.FromName = item.FromName;
                    mfbmsg.FromProfilePic = item.FromProfilePic;
                    mfbmsg.InstagramId = item.InstagramId;
                    mfbmsg.strId = item.Id.ToString();

                    mongorepo.Add<Domain.Socioboard.MongoDomain.InstagramComment>(mfbmsg);
                }
                skip = skip + 50;
            }

            return output;
        }