There are three classes, consider:
Find the tag and reply for all posts in a relatively superior way:
Class post{public int ID {get; set;} public int TagId {get; set;} public int Replyid {get; set;}} Class tag{public int ID {get; set;} public string Name {get; set;}} Class reply{public int ID {get; set;} public string Name {get; set;}}
In order to facilitate the description, then a given three list<t>:
list<post> postlist = new list<post> (); list<tag> tagList = new list<tag> (); list<reply> replylist = new list<reply> ();
Ideas:
1: Facilitate taglist and replylist respectively and convert to dictionary
2: Convenient postlist, and according to the ID to obtain the corresponding information
Principle:
Fully leverages the concept of the index (dictionary for the Keyvaluepars list)
This article is from the "lybing" blog, make sure to keep this source http://lybing.blog.51cto.com/3286625/1790134
List of. NET