Reputation: 47
Hi all here comes a noob question,
i am trying around with twitter library "linq2twitter" in C#. I would like to get the content from :
System.Collections.Generic.List <.LinqToTwitter.MediaEntity.>
My attempt is simple:
public string[] MediaContent;
MediaContent = tweet.Entities.MediaEntities.ToArray()
I tried to convert it into an string[] array with the .ToArray() function but i am getting an the error "conversion from Type LinqToTwitter.MediaEntity[] in string[] is not possible"
I guess there is a better way to get the data from this Type of List ? Can someone give me a tip?
thx,
Fid
Upvotes: 1
Views: 288
Reputation: 7513
You could use the technique in thorkia's comment to obtain one of the string properties of MediaEntity, but it's not clear that's what you want. Here's how to convert the List to a MediaEntity[]:
public MediaEntity[] MediaContent;
MediaContent = tweet.Entities.MediaEntities.ToArray()
Here, all I did was change the array type from string[] to MediaEntity[].
Upvotes: 1