foreach (var item in tweets)
{
XmlNode user = users[i];
XmlNode text = texts[i];
XmlNode id = ids[i];
string userstr = user.InnerText;
string textstr = text.InnerText;
string idstr = id.InnerText;
tweet.user = userstr;
tweet.text = textstr;
tweet.id = idstr;
tweetlist.Add(tweet);
++i;
}
return tweetlist;
i put a break by the tweetlist.add(tweet) line so i'm sure that it is getting the correct data but everytime it adds a new item to the list it replaces the first one and adds a new one for example
List{id = 1, name = "bob"} + {id = 2, name = "jenny"}
becomes
list {id = 2 name = "jenny"}, {id = 2 , name = "jenny"}