.NET ֮ List

��˼����

�������ֱ�Ϊ��Post��Tag��Reply����һ����Խ��ŵ��㷨���������������ӵ�Tag��Reply��Ϣ��

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 TagName { get; set; }
}
class Reply
{
    public int ID { get; set; }
    public string ReplyContent { get; set; }
}

Ϊ�˷�����������ô�͸����List<T>��

List<Post> postList = new List<Post>();
List<Tag> tagList = new List<Tag>();
List<Reply> replyList = new List<Reply>();

˼·��

1���ֱ����tagList��replyList��ת��ΪDictionary

2������postList�������Id����ȡ��Ӧ����Ϣ

ԭ�?

�������������ĸ���(DictionaryΪKeyValuePars��List)

���ij��� ��lybing�� ���ͣ�����ر����˳���http://lybing.blog.51cto.com/3286625/1790134

你可能感兴趣的:(.NET ֮ List)