I'm using TweetInvi to grab a bunch of tweets that match a specified hashtag. I do this with the following:
var matchingTweets = Search.SearchTweets(hashtag);
This returns an IEnumerable (named ITweet
, interface of Tweet
), however I cannot create a List<>
of Tweets
, because Tweet
is a static type.
I made, instead, a list of objects
, using:
List<object> matches = matchingTweets.Cast<object>().ToList();
However, although each member of the matchingTweets
IEnumerable has a number of properties, I cannot access them using:
long tweetID = matches[i].<property>;
Using matches[i].ToString()
returns the tweet content, so how can I effectively cast the results in matchingTweets
to a list, and subsequently access the properties of those list members? I would ideally like to avoid using dynamic
.