private void ProcessTwitterProfile(string blobText, T_CollectionTask t_newTask)
        {
            //1-Deserialize
            TwitterUser user = JsonConvert.DeserializeObject <TwitterUser>(blobText);

            T_TwitterUser t_user = new T_TwitterUser();

            t_user.CollectionTaskId      = t_newTask.Id;
            t_user.CreatedDate           = user.CreatedDate;
            t_user.Description           = user.Description;
            t_user.FavoritesCount        = user.FavouritesCount;
            t_user.FollowersCount        = user.FollowersCount;
            t_user.FriendsCount          = user.FriendsCount;
            t_user.IsContributorsEnabled = user.ContributorsEnabled;
            t_user.IsGeoEnabled          = user.IsGeoEnabled;
            t_user.IsProtected           = user.IsProtected;
            t_user.IsVerified            = user.IsVerified;
            t_user.Language    = user.Language;
            t_user.ListedCount = user.ListedCount;
            t_user.Location    = user.Location;
            t_user.Name        = user.Name;
            t_user.ProfileBackgroundImageUrl = user.ProfileBackgroundImageUrl;
            t_user.ProfileImageUrl           = user.ProfileImageUrl;
            t_user.ScreenName    = user.ScreenName;
            t_user.StatusesCount = user.StatusesCount;
            t_user.TimeZone      = user.TimeZone;
            t_user.Url           = user.Url;
            t_user.UserId        = user.Id;
            t_user.UtcOffset     = user.UtcOffset;

            //2-Validate


            //3-Update
            LinqToSqlAzureHaystackDataContext context = new LinqToSqlAzureHaystackDataContext();

            context.T_TwitterUsers.InsertOnSubmit(t_user);
            context.SubmitChanges();
        }
        public void PopulateTwitterFollowers()
        {
            LinqToSqlAzureHaystackDataContext context = new LinqToSqlAzureHaystackDataContext();

            IQueryable <T_TwitterUser> users =
                from r in context.T_TwitterUsers
                select r;

            IQueryable <T_TwitterFollower> followers =
                from r in context.T_TwitterFollowers
                where r.Complete == null
                select r;

            int counter = 0;

            foreach (T_TwitterFollower follower in followers)
            {
                T_TwitterUser targetUser = users.FirstOrDefault <T_TwitterUser>(user => user.ScreenName == follower.TargetUserName);
                if (targetUser != null)
                {
                    if (follower.TargetId != targetUser.UserId)
                    {
                        follower.TargetId = targetUser.UserId;
                    }
                }
                T_TwitterUser sourceUser = users.FirstOrDefault <T_TwitterUser>(user => user.UserId == follower.SourceId);
                if (sourceUser != null)
                {
                    follower.SourceUserName = sourceUser.ScreenName;
                    follower.Complete       = true;
                }

                counter++;
                if (counter > 100)
                {
                    context.SubmitChanges();
                    counter = 0;
                }
            }
            context.SubmitChanges();


            IQueryable <T_TwitterFriend> friends =
                from r in context.T_TwitterFriends
                where r.Complete == null
                select r;

            counter = 0;
            foreach (T_TwitterFriend friend in friends)
            {
                T_TwitterUser sourceUser = users.FirstOrDefault <T_TwitterUser>(user => user.ScreenName == friend.SourceUserName);
                if (sourceUser != null)
                {
                    if (friend.SourceId != sourceUser.UserId)
                    {
                        friend.SourceId = sourceUser.UserId;
                    }
                }

                T_TwitterUser targetUser = users.FirstOrDefault <T_TwitterUser>(user => user.UserId == friend.TargetId);
                if (targetUser != null)
                {
                    friend.TargetUserName = targetUser.ScreenName;
                    friend.Complete       = true;
                }

                counter++;
                if (counter > 100)
                {
                    context.SubmitChanges();
                    counter = 0;
                }
            }
            context.SubmitChanges();
        }