This project has moved and is read-only. For the latest updates, please go here.

Extended Entities

Apr 2, 2015 at 3:05 PM

I am quiet new to linq2twitter and i have a question about the ExtendedEntities:

I am trying to retrieve 2 Photos from a Status that i got from a search.

So my attempt is to search for a keyword and then i try to get the ExtendedEntities from the
Status of the search result.

So created a >Status[] SearchStatus< in tweet class.

In my SearchClass i have:

var twitterCtx = new TwitterContext(SharedState.Authorizer);
        var tweets =
            (from tweet in twitterCtx.Search
             where tweet.Type == SearchType.Search &&
               tweet.Query == TxtBxSerachQuery.Text && tweet.Count ==  numMaxTweets.Value
             select new Tweet

                 SearchStatuses = tweet.Statuses.ToArray()  


tweets.ForEach( tweet =>
       int Count = tweet.SearchStatuses.Length;

        for (int i = 0; i < Count; i++ )
          // trying to get the number of ExtendedEntities.MediaEntities 
          int NumExMedia = tweet.SearchStatuses[i].ExtendedEntities.MediaEntities.Count;


I do always get a System.NullReferenceException when it comes to the >NumExMedia<? Is there nothing in this Extended Entities ? I am searching for my own name (chriswattz) and in the first 2 results i will get the standart MediaEntities without a problem but there is just one image inside, the second one does not show up.

So i know that the ExtendedEntities.MediaEntities should contain them but i do always get a NullReferenceExpetion....someone has an idea?


Apr 2, 2015 at 6:22 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.